Advertisement
Guest User

Untitled

a guest
Nov 26th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. input {
  2. udp {
  3. port => 5000
  4. codec => json
  5. }
  6. tcp {
  7. port => 5000
  8. codec => json
  9. }
  10. }
  11.  
  12. filter {
  13. grok {
  14. match => { "message" => "%{SYSLOG5424PRI}%{NONNEGINT:ver} +(?:%{TIMESTAMP_ISO8601:ts}|-) +(?:%{HOSTNAME:service}|-) +(?:%{NOTSPACE:containerName}|-) +(?:%{NOTSPACE:proc}|-) +(?:%{WORD:msgid}|-) +(?:%{SYSLOG5424SD:sd}|-|) +%{GREEDYDATA:msg}" }
  15. }
  16. syslog_pri { }
  17. date {
  18. match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
  19. }
  20. mutate {
  21. remove_field => [ "message", "priority", "ts", "severity", "facility", "facility_label", "severity_label", "syslog5424_pri", "proc", "syslog_severity_code", "syslog_facility_code", "syslog_facility", "syslog_severity", "syslog_hostname", "syslog_message", "syslog_timestamp", "ver" ]
  22. }
  23. mutate {
  24. remove_tag => [ "_grokparsefailure_sysloginput" ]
  25. }
  26. mutate {
  27. gsub => [
  28. "service", "[0123456789-]", ""
  29. ]
  30. }
  31. if [msg] =~ "^ *{" {
  32. json {
  33. source => "msg"
  34. }
  35. if "_jsonparsefailure" in [tags] {
  36. drop {}
  37. }
  38. mutate {
  39. remove_field => [ "msg" ]
  40. }
  41. }
  42. else { drop{} }
  43. if ("" in [msg]) {
  44. mutate {
  45. rename => { "msg" => "message" }
  46. }
  47. }
  48. mutate {
  49. remove_field => [ "tags" ]
  50. }
  51. }
  52.  
  53. output {
  54. stdout {}
  55. elasticsearch {
  56. hosts => "elastic:9200"
  57. user => "elastic"
  58. password => "changeme"
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement