Skip to content

Instantly share code, notes, and snippets.

@KensoDev
Created December 10, 2014 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KensoDev/b483d07dbe17f40e0767 to your computer and use it in GitHub Desktop.
Save KensoDev/b483d07dbe17f40e0767 to your computer and use it in GitHub Desktop.
Ship Logs to logstash using Rsyslog
$ModLoad imfile # Load the imfile input module
# <syslog-tag> Tag you give to syslog in order to identigy the input coming from this file eg: nginx-access/rails/some_other_name
# <statefile-name> What do you want the state file to be called eg: nginx-access-state
# use @@ if you want to send logs over TCP
# use @ if you want to send logs over UDP
$InputFileName /path/to_log_location.log
$InputFileTag <syslog-tag>:
$InputFileStateFile <statefile-name>
$InputRunFileMonitor
:syslogtag , isequal , "<syslog-tag>:" @@<logstash-location>:<logstash-port>
& ~ # Don't handle this anymore down the chain...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment