Skip to content

Instantly share code, notes, and snippets.

@jdutton
Created April 2, 2013 19:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jdutton/5295456 to your computer and use it in GitHub Desktop.
Save jdutton/5295456 to your computer and use it in GitHub Desktop.
Rsyslog conf file to send rsyslog output to logstash as a native json logstash event. For more info - see blog post at http://untergeek.com/2012/10/11/using-rsyslog-to-send-pre-formatted-json-to-logstash/
# Send a native logstash json event to the logstash server
$template ls_json,"{%timestamp:::date-rfc3339,jsonf:@timestamp%,\"@message\":\"%msg:::json%\",\"@fields\":{%fromhost:::jsonf:host%,%syslogfacility-text:::jsonf:syslog_facility%,%syslogfacility:::jsonf:syslog_facility_code%,%syslogseverity-text:::jsonf:syslog_severity%,%syslogseverity:::jsonf:syslog_severity_code%,%app-name:::jsonf:program%,%procid:::jsonf:pid%}}"
*.* @@mylogstashhost:5543;ls_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment