From d5a6e3ea12fe24311258ebfc76d6f1f8c28139d3 Mon Sep 17 00:00:00 2001 From: Gabriel BLEU Date: Fri, 17 Jun 2016 15:17:16 +0200 Subject: [PATCH] Better elastic beanstalk sample --- examples/remote_syslog.ebextensions.config | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/remote_syslog.ebextensions.config b/examples/remote_syslog.ebextensions.config index 9d5253f..4b4c136 100644 --- a/examples/remote_syslog.ebextensions.config +++ b/examples/remote_syslog.ebextensions.config @@ -1,7 +1,7 @@ # See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/ # Usage: -# - replace with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz -# - replace with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log +# - replace with the version of remote_syslog2 you want to use. Example: .../download/v0.17/remote_syslog_linux_amd64.tar.gz +# - replace with the files you want to monitor for new log lines. Example: - /var/log/tomcat*/catalina.out # - replace and with the values shown under log destinations: https://papertrailapp.com/account/destinations sources: @@ -15,7 +15,8 @@ files: encoding: plain content: | files: - - + - path: + tag: ##WILL_BE_REPLACED## hostname: ##WILL_BE_REPLACED## destination: host: @@ -32,11 +33,12 @@ files: logger_config="/etc/log_files.yml" appname=`{ "Ref" : "AWSEBEnvironmentName" }` instid=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id` - myhostname=${appname}_${instid} if [ -f $logger_config ]; then + # Sub the tag + sed "s/tag:.*/tag: $instid/" -i $logger_config # Sub the hostname - sed "s/hostname:.*/hostname: $myhostname/" -i $logger_config + sed "s/hostname:.*/hostname: $appname/" -i $logger_config fi "/etc/init.d/remote_syslog":