Skip to content

Commit 8cf506b

Browse files
author
Christopher M. Neill
committed
We are now tagging with {{name}} so use it!
1 parent 5feded7 commit 8cf506b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ansible/roles/loggly/templates/21-output-syslog.conf.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ $WorkDirectory /var/spool/rsyslog
22

33
# Rotate per hour
44
$template RotateHourly_{{ name }},"{{ app_log_dir }}/%$YEAR%/%$MONTH%/%$DAY%/%$HOUR%/{{ name }}.log"
5-
if $msg contains '{{ name }}' and $syslogfacility-text == 'local7' then { action (type="omfile" DynaFile="RotateHourly_{{ name }}" template="RunnableJSON" dirCreateMode="0755" FileCreateMode="0644") }
5+
if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then { action (type="omfile" DynaFile="RotateHourly_{{ name }}" template="RunnableJSON" dirCreateMode="0755" FileCreateMode="0644") }
66

77
# Loggly: Add a tag for {{ name }} events
8-
$template LogglyFormat_{{ name }},"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [{{ loggly_token }}@41058 tag=\"runnable\" tag=\"{{ node_env }}\"] %msg%\n"
9-
if $msg contains '{{ name }}' and $syslogfacility-text == 'local7' then @@logs-01.loggly.com:6514;LogglyFormat_{{ name }}
10-
if $msg contains '{{ name }}' and $syslogfacility-text == 'local7' then stop
8+
$template LogglyFormat_{{ name }},"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %syslogtagid% [{{ loggly_token }}@41058 tag=\"runnable\" tag=\"{{ node_env }}\"] %syslogtag%\n"
9+
if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then @@logs-01.loggly.com:6514;LogglyFormat_{{ name }}
10+
if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then stop

0 commit comments

Comments
 (0)