Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leonsodhi/6721295 to your computer and use it in GitHub Desktop.
Save leonsodhi/6721295 to your computer and use it in GitHub Desktop.
########################################
# Global directives #
########################################
User nxlog
Group nxlog
LogFile /var/log/nxlog/nxlog.log
LogLevel INFO
########################################
# Modules #
########################################
<Extension _syslog>
Module xm_syslog
</Extension>
<Extension _fileop>
Module xm_fileop
</Extension>
# Monitor application log file
<Input watchfile>
Module im_file
File "/path/to/your/*.log"
Exec $Message = $raw_event;
Exec $SourceName = file_basename(file_name());
</Input>
<Processor filewatcher_transformer>
Module pm_transformer
# Uncomment to override the program name
# Exec $SourceName = 'PROGRAM NAME';
# Uncomment to override the hostname
# Exec $Hostname = 'HOSTNAME';
OutputFormat syslog_rfc5424
</Processor>
<Output syslogout>
Module om_ssl
Host logs.papertrailapp.com
Port YOUR_PORT
CAFile /etc/syslog.papertrail.crt
AllowUntrusted FALSE
</Output>
<Route 1 >
Path watchfile => filewatcher_transformer => syslogout
</Route>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment