Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. input {
  2. tcp {
  3. port => 5544
  4. type => 'iis'
  5. }
  6.  
  7. file {
  8. path => 'C:/XXX/IIS/SitefinityLogs/*Error*.log'
  9. type => 'sitefinity'
  10. start_position =>'end'
  11. }
  12. }
  13.  
  14. filter {
  15. if [type] == 'iis' {
  16. #ignore log comments
  17. if [message] =~ "^#" {
  18. drop {}
  19. }
  20.  
  21.  
  22. grok {
  23. # check that fields match your IIS log settings
  24. match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{IPORHOST:cshost} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:time_taken} %{IPORHOST:sourceip}"]
  25. }
  26.  
  27. #Set the Event Timesteamp from the log
  28. date {
  29. match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss" ]
  30. timezone => "Etc/UTC"
  31. }
  32.  
  33.  
  34. useragent {
  35. source=> "useragent"
  36. prefix=> "browser"
  37. }
  38.  
  39. geoip {
  40. source => "sourceip"
  41. target => "geoip"
  42. add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ]
  43. add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ]
  44. }
  45.  
  46.  
  47. mutate {
  48. remove_field => [ "log_timestamp"]
  49. convert => [ "[geoip][coordinates]", "float" ]
  50. convert => [ "time_taken", "integer" ]
  51. convert => [ "response", "integer" ]
  52. convert => [ "scstatus", "integer" ]
  53. }
  54. }
  55.  
  56. if [type] == 'sitefinity' {
  57. multiline {
  58. # 12/20/2015 06:42:30
  59. pattern => "^Timestamp: [0-9]{2}/[0-9]{2}/[0-9]{4} ([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"
  60. # pattern => '%{TIMESTAMP_SF}'
  61. what => 'previous'
  62. negate => true
  63. }
  64. }
  65. }
  66.  
  67. output {
  68. elasticsearch {
  69. hosts => ["XX.XXX.XXX.XXX:9200", "XXX.XXX.XXX.XXX:9200"]
  70. user => "logstash"
  71. password => "XXXXXX"
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement