Skip to content

Instantly share code, notes, and snippets.

@VerosK
Last active August 29, 2015 14:07
Show Gist options
  • Save VerosK/73e553897d0d33bd1c17 to your computer and use it in GitHub Desktop.
Save VerosK/73e553897d0d33bd1c17 to your computer and use it in GitHub Desktop.
nxlog - send input from file to syslog
<Extension _syslog>
Module xm_syslog
</Extension>
<Input in1>
Module im_file
File "/tmp/input.txt"
Exec $message = $raw_event; $SourceName = file_name();
Exec if $SourceName =~ /(\/.*\/)([^\/]*)$/ $SourceName = $2;
Exec if $SourceName =~ /(.*\\.*\\)([^\\]*)$/ $SourceName = $2;
</Input>
<Output fileout1>
Module om_file
File "/tmp/output.txt"
# Exec if $Message =~ /error/ $SeverityValue = syslog_severity_value("error");
Exec to_syslog_bsd();
</Output>
<Route 1>
Path in1 => fileout1
</Route>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment