Closed Jolg42 closed 5 years ago
@Jolg42
I'll make sure to test your config today and close out this issue.
Best,
Carlos
files: "/home/ec2-user/logdna.sh" : mode: "000777" owner: root group: root content: |
!/bin/sh
rpm --import https://repo.logdna.com/logdna.gpg echo "[logdna] name=LogDNA packages baseurl=https://repo.logdna.com/el6/ enabled=1 gpgcheck=1 gpgkey=https://repo.logdna.com/logdna.gpg" | sudo tee /etc/yum.repos.d/logdna.repo yum -y install logdna-agent logdna-agent -k INSERT_KEY_HERE # this is your unique Ingestion Key
/var/log is monitored/added by default (recursively), optionally add more dirs here (remove # to uncomment the line)
logdna-agent -d /path/to/your/logs
--hostname allows you to pass your env hostname/appname to LogDNA (remove # to uncomment the line below)
logdna-agent --hostname
{"Ref": "AWSEBEnvironmentName" }
-t option allows you to tag the host with tags (remove # to uncomment the line below)
logdna-agent -t
{"Ref": "AWSEBEnvironmentName" }
chkconfig logdna-agent on service logdna-agent start commands: 01_install_logdna: command: "/home/ec2-user/logdna.sh" 02_restart_logdna: command: "service logdna-agent restart"
@Jolg42,
As I got informed, all is working well now; so, closing this issue!
Happy Logging!
Posting a working example as a reference:
files:
"/home/ec2-user/logdna.sh" :
mode: "000777"
owner: root
group: root
content: |
#!/bin/sh
rpm --import https://repo.logdna.com/logdna.gpg
echo "[logdna]
name=LogDNA packages
baseurl=https://repo.logdna.com/el6/
enabled=1
gpgcheck=1
gpgkey=https://repo.logdna.com/logdna.gpg" | sudo tee /etc/yum.repos.d/logdna.repo
yum -y install logdna-agent
logdna-agent -k INSERT_KEY_HERE # this is your unique Ingestion Key
# /var/log is monitored/added by default (recursively), optionally add more dirs here
# logdna-agent -d /var/app/current/logs
# --hostname allows you to pass your env hostname/appname to LogDNA
logdna-agent --hostname `{"Ref": "AWSEBEnvironmentName" }`
# -t option allows you to tag the host with tags
logdna-agent -t CUSTOMTAG
chkconfig logdna-agent on
service logdna-agent start
commands:
01_install_logdna:
command: "/home/ec2-user/logdna.sh"
02_restart_logdna:
command: "service logdna-agent restart"
Thanks, @Jolg42!
Hi,
I tried to add tags and change the hostname on AWS Elastic Beanstalk. In the logs I found
Hostname: FSDEV saved to config. Tags: FSDEV has been saved to config.
It looks like it worked but I don't see anything on the dashboard, does it take a long time to appear maybe?
Here is my config file: