Skip to content

Instantly share code, notes, and snippets.

@avnersorek
Last active May 11, 2017 04:03
Show Gist options
  • Save avnersorek/498a894160cb1e425227 to your computer and use it in GitHub Desktop.
Save avnersorek/498a894160cb1e425227 to your computer and use it in GitHub Desktop.
AWS Elastic Beanstalk configuration script for forwarding logs to LogDNA
# Place this file in the .ebextensions folder of your project
files:
"/home/ec2-user/logdna.sh" :
mode: "000777"
owner: root
group: root
content: |
#!/bin/sh
echo "[logdna]
name=LogDNA packages
baseurl=http://repo.logdna.com/el6/
enabled=1
gpgcheck=0" | tee /etc/yum.repos.d/logdna.repo
yum -y install logdna-agent
logdna-agent -k ### LogDNA-API-KEY ###
# /var/log is monitored/added by default (recursively), optionally specify more folders here
logdna-agent -d /var/log/nodejs/nodejs.log
chkconfig logdna-agent on
service logdna-agent start
commands:
logdna:
command: "/home/ec2-user/logdna.sh"
@fmundaca
Copy link

Hello, great job with the script !!

i would like to know how can i exclude some logs. With -d param i can add an specific file to watch but i would like to stop seeing som files.

hope that u can help me !
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment