Guest User

Untitled

a guest
Jul 15th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1.  
  2. filter {
  3.  
  4. # Extract fields from the each of the detailed message types
  5. # The patterns provided below are included in core of LogStash 1.4.2.
  6. grok {
  7. match => [
  8. "message", "%{CISCOFW106001}",
  9. "message", "%{CISCOFW106006_106007_106010}",
  10. "message", "%{CISCOFW106014}",
  11. "message", "%{CISCOFW106015}",
  12. "message", "%{CISCOFW106021}",
  13. "message", "%{CISCOFW106023}",
  14. "message", "%{CISCOFW106100}",
  15. "message", "%{CISCOFW110002}",
  16. "message", "%{CISCOFW302010}",
  17. "message", "%{CISCOFW302013_302014_302015_302016}",
  18. "message", "%{CISCOFW302020_302021}",
  19. "message", "%{CISCOFW305011}",
  20. "message", "%{CISCOFW313001_313004_313008}",
  21. "message", "%{CISCOFW313005}",
  22. "message", "%{CISCOFW402117}",
  23. "message", "%{CISCOFW402119}",
  24. "message", "%{CISCOFW419001}",
  25. "message", "%{CISCOFW419002}",
  26. "message", "%{CISCOFW500004}",
  27. "message", "%{CISCOFW602303_602304}",
  28. "message", "%{CISCOFW710001_710002_710003_710005_710006}",
  29. "message", "%{CISCOFW713172}",
  30. "message", "%{CISCOFW733100}"
  31. ]
  32. }
  33.  
  34. # Parse the syslog severity and facility
  35. syslog_pri { }
  36.  
  37.  
  38. alter {
  39. condrewrite =>[
  40. "action", "denied by ACL", "deny",
  41. "action", "Deny", "deny",
  42. "action", "Denied", "deny",
  43. "action", "denied", "deny"
  44. ]
  45.  
  46. alter {
  47. condrewrite =>[
  48. "protocol", "TCP", "tcp",
  49. "protocol", "UDP", "udp",
  50. "protocol", "ICMP", "icmp",
  51. "protocol", "DNS", "dns"
  52. ]
  53. }
  54.  
  55.  
  56. # Do a DNS lookup for the sending host
  57. # Otherwise host field will contain an
  58. # IP address instead of a hostname
  59. #mutate {
  60. # add_field => { "dst_resolved" => "%{dst_ip}" }
  61. #}
  62.  
  63. #dns {
  64. # reverse => [ "[dst_resolved]" ]
  65. # action => "replace"
  66. # }
  67.  
  68. geoip {
  69. #add_tag => [ "Whois" ]
  70. source => "src_ip"
  71. target => "src_geoip"
  72. database => "/etc/logstash/geoDB/GeoLiteCity.dat"
  73. add_field => [ "[src_geoip][coordinates]", "%{[src_geoip][longitude]}" ]
  74. add_field => [ "[src_geoip][coordinates]", "%{[src_geoip][latitude]}" ]
  75. }
  76. mutate {
  77. convert => [ "[src_geoip][coordinates]", "float"]
  78. }
  79. mutate {
  80. add_field => { "whois" => "https://who.is/whois-ip/ip-address/%{dst_ip}"}
  81. }
  82.  
  83. # do GeoIP lookup for the ASN/ISP information.
  84. geoip {
  85. database => "/etc/logstash/geoDB/GeoIPASNum.dat"
  86. source => "src_ip"
  87. }
  88.  
  89. geoip {
  90. #add_tag => [ "Whois" ]
  91. source => "dst_ip"
  92. target => "dst_geoip"
  93. database => "/etc/logstash/geoDB/GeoLiteCity.dat"
  94. add_field => [ "[dst_geoip][coordinates]", "%{[dst_geoip][longitude]}" ]
  95. add_field => [ "[dst_geoip][coordinates]", "%{[dst_geoip][latitude]}" ]
  96. }
  97. mutate {
  98. convert => [ "[dst_geoip][coordinates]", "float"]
  99. }
  100. # do GeoIP lookup for the ASN/ISP information.
  101. geoip {
  102. database => "/etc/logstash/geoDB/GeoIPASNum.dat"
  103. source => "dst_ip"
  104. }
  105.  
  106. }
Advertisement
Add Comment
Please, Sign In to add comment