Skip to content

Instantly share code, notes, and snippets.

@mishok13
Last active August 29, 2015 13:55
Show Gist options
  • Save mishok13/8707503 to your computer and use it in GitHub Desktop.
Save mishok13/8707503 to your computer and use it in GitHub Desktop.
RSyslog configuration with dynamic path and overwritten message format
$template TestFormat,"Message: %msg%\n"
$template TestFile,"/tmp/test_%$year%%$month%%$day%%$hour%.log"
# Writes matching messages to path defined by TestFile template in TestFormat format
:syslogtag, contains, "test" -?TestFile;TestFormat
# Drops messages matching this syslog tag
:syslogtag, contains, "test" ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment