Skip to content

Instantly share code, notes, and snippets.

@jonuwz
Created April 8, 2022 15:55
Show Gist options
  • Save jonuwz/2571e26b232e8d388aaee87f6a95ba49 to your computer and use it in GitHub Desktop.
Save jonuwz/2571e26b232e8d388aaee87f6a95ba49 to your computer and use it in GitHub Desktop.
template(
name="RSYSLOG_SyslogProtocol23Format_NoHead"
type="string"
string="%TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n"
)
template (name="DynFile" type="string" string="/var/log/docker/%app-name%.log")
template(
name="MSG_only"
type="string"
string="%msg%\n"
)
ruleset(name="processDocker") {
action(
type="omfile"
dirCreateMode="0700"
FileCreateMode="0644"
dynaFile="DynFile"
Template="MSG_only"
)
}
input(
type="imuxsock"
Socket="/var/run/dockerlog.sock"
SysSock.RateLimit.Interval="0"
useSpecialParser="off"
Ruleset="processDocker"
)
{
"log-driver": "syslog",
"log-opts": {
"syslog-address": "unixgram:///var/run/dockerlog.sock",
"syslog-format": "rfc5424",
"tag": "{{.Name}}/{{.FullID}}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment