Advertisement
Guest User

10-syslog.conf

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