-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathloggly_gen2.config
More file actions
39 lines (38 loc) · 2.13 KB
/
Copy pathloggly_gen2.config
File metadata and controls
39 lines (38 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
files:
"/etc/rsyslog.d/22-loggly.conf" :
mode: "000664"
owner: root
group: root
content: |
# -------------------------------------------------------
# Syslog Logging Directives for Loggly (sig2.loggly.com)
# -------------------------------------------------------
# Define the template used for sending logs to Loggly. Do not change this format.
$template LogglyFormat,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [LOGGLY_SECRET_KEY tag=\"APPLICATION_NAME_<RACK_ENV>\"] %msg%"
# Send messages to syslog server listening on TCP port using template
*.* @@logs-01.loggly.com:514;LogglyFormat
# -------------------------------------------------------
# End of Syslog Logging Directives for Loggly
# -------------------------------------------------------
encoding: plain
commands:
00_loggly_command:
command: "touch /tmp/$(date '+%F.%T.%N').loggly_cmd_00"
01_rsyslog_dot_d_remove_90_loggly:
command: if [ -e /etc/rsyslog.d/90-loggly.conf ]; then rm /etc/rsyslog.d/90-loggly.*; fi
ignoreErrors: true
01a_loggly_command:
command: "touch /tmp/$(date '+%F.%T.%N').loggly_cmd_01a"
02_rsyslog_conf_remove_90_loggly:
command: test "$(grep -s '90-loggly.conf' /etc/rsyslog.conf)" == "\$IncludeConfig /etc/rsyslog.d/90-loggly.conf" && perl -pi -e 's/\$IncludeConfig \/etc\/rsyslog.d\/90-loggly.conf//g' /etc/rsyslog.conf && perl -pi -e 's/# Include the loggly.conf file//g' /etc/rsyslog.conf || echo ".ebextensions loggly.conf - no rsyslog updates needed"
ignoreErrors: true"
02a_loggly_command:
command: "touch /tmp/$(date '+%F.%T.%N').loggly_cmd_02a"
03-source-environment-variables-set-loggy-tag:
command: "source /opt/elasticbeanstalk/support/envvars && perl -pi -e 's/<RACK_ENV>/$ENV{RACK_ENV}/g' /etc/rsyslog.d/22-loggly.conf"
03a_loggly_command:
command: "touch /tmp/$(date '+%F.%T.%N').loggly_cmd_03a"
04-restart-syslog:
command: service rsyslog restart
04a_loggly_command:
command: "touch /tmp/$(date '+%F.%T.%N').loggly_cmd_4a"