Skip to content

Instantly share code, notes, and snippets.

@Jolg42
Created December 4, 2018 11:11
Show Gist options
  • Save Jolg42/6f1a7cc0478c945f245982172919e1df to your computer and use it in GitHub Desktop.
Save Jolg42/6f1a7cc0478c945f245982172919e1df to your computer and use it in GitHub Desktop.
00_logdna.config
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 <KEY> # 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
logdna-agent --hostname `{"Ref": "AWSEBEnvironmentName" }`
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment