grawity

Untitled

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