Skip to content

Instantly share code, notes, and snippets.

@RaphaelAudet
Last active December 31, 2015 12:49
Show Gist options
  • Save RaphaelAudet/7988631 to your computer and use it in GitHub Desktop.
Save RaphaelAudet/7988631 to your computer and use it in GitHub Desktop.
80-senttoci.conf
$LocalHostName myhost
# load module to read from local files
$ModLoad imfile
# for each local log file path, duplicate the 6 lines below and edit lines 2-4
$RuleSet sendtoci # use a non-default ruleset (keeps logs out of /var/log/)
$InputFileName /var/www/app/shared/log/production.log
$InputFileTag unicorn:
$InputFileStateFile sendtoci-unicorn
$InputFilePersistStateInterval 100 # update state file every 100 lines
$InputRunFileMonitor
$InputFileName /var/www/app/shared/log/unicorn-stderr.log
$InputFileTag unicornerr:
$InputFileStateFile sendtoci-unicornerr
$InputFilePersistStateInterval 100 # update state file every 100 lines
$InputRunFileMonitor
$InputFileName /var/www/app/shared/log/unicorn-stdout.log
$InputFileTag unicornout:
$InputFileStateFile sendtoci-unicornout
$InputFilePersistStateInterval 100 # update state file every 100 lines
$InputRunFileMonitor
# destination
*.* @xx.xx.xx.XX #udp forwarding 514
# for clarity, explicitly discard everything (this is typically not necessary)
*.* ~
# all done. change to default ruleset (RSYSLOG_DefaultRuleset) for any following config
$RuleSet RSYSLOG_DefaultRuleset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment