Advertisement
k3NGuru

10-syslog.conf

Feb 17th, 2015
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | None | 0 0
  1. filter {
  2.  
  3.     if "Ready" not in [tags] {
  4.       mutate {
  5.         add_tag => [ "syslog" ]
  6.       }
  7.     }
  8.   }
  9. }
  10.  
  11. filter {
  12.   if [type] == "syslog" {
  13.     mutate {
  14.       remove_tag => "Ready"
  15.     }
  16.   }
  17. }
  18.  
  19. filter {
  20.   if "syslog" in [tags] {
  21.     grok {
  22.       match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
  23.       add_field => [ "received_at", "%{@timestamp}" ]
  24.       add_field => [ "received_from", "%{host}" ]
  25.     }
  26.     syslog_pri { }
  27.     date {
  28.       match => [ "syslog_timestamp", "MMM  d HH:mm:ss", "MMM  dd HH:mm:ss" ]
  29.       locale => "en"
  30.     }
  31.  
  32.     if !("_grokparsefailure" in [tags]) {
  33.       mutate {
  34.         replace => [ "@source_host", "%{syslog_hostname}" ]
  35.         replace => [ "@message", "%{syslog_message}" ]
  36.       }
  37.     }
  38.  
  39.     mutate {
  40.       remove_field => [ "syslog_hostname", "syslog_message", "syslog_timestamp" ]
  41.     }
  42. #    if "_grokparsefailure" in [tags] {
  43. #      drop { }
  44. #    }
  45.   }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement