Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. input {
  2. beats {
  3. port => 5044
  4. }
  5. }
  6. filter {
  7.  
  8. # linux journal entry
  9. if [type] == "journal" {
  10.  
  11. mutate {
  12. update => {
  13. "type" => "journal-log"
  14. }
  15. }
  16.  
  17. # docker container log entry
  18. if [CONTAINER_NAME] {
  19.  
  20. mutate {
  21. update => {
  22. "type" => "docker-log"
  23. }
  24. }
  25.  
  26. # parse a Mule app log
  27. grok {
  28. match => [ "MESSAGE", "%{LOGLEVEL:loglevel}\s+%{TIMESTAMP_ISO8601:timestamp}\s+\[\[%{DATA:app}\]\.%{DATA:thread}\]\s+%{DATA:category}:\s+%{GREEDYDATA:msgbody}" ]
  29. remove_tag => ["_grokparsefailure"]
  30. }
  31. if "_grokparsefailure" in [tags] {
  32. grok {
  33. match => [ "MESSAGE", "%{TIMESTAMP_ISO8601:timestamp}\s+\[\[%{DATA:app}\]%{DATA:thread}\]\s+%{LOGLEVEL:loglevel}\s+%{JAVACLASS:category}\s+-\s+%{GREEDYDATA:msgbody}" ]
  34. remove_tag => ["_grokparsefailure"]
  35. }
  36. }
  37. if "_grokparsefailure" not in [tags] {
  38. mutate {
  39. update => {
  40. "type" => "mule-app-log"
  41. }
  42. rename => {
  43. "MESSAGE" => "message"
  44. }
  45. }
  46. kv {
  47. source => "msgbody"
  48. allow_duplicate_values => false
  49. }
  50. date {
  51. match => ["timestamp","yyyy-MM-dd HH:mm:ss,SSS"]
  52. remove_field => ["timestamp"]
  53. }
  54. }
  55. }
  56. }
  57. }
  58.  
  59. output {
  60. elasticsearch {
  61. hosts => ["<<host>>"]
  62. manage_template => false
  63. index => "beats-%{+YYYY.MM.dd}"
  64. }
  65.  
  66. # debug output
  67. stdout {
  68. codec => rubydebug
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement