Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- configuration :
- input {
- stdin { }
- }
- filter {
- mutate { replace => { "type" => "apache_access" } }
- grok {
- match => { "message" => "%{COMBINEDAPACHELOG}" }
- }
- date {
- match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
- }
- mutate {
- convert => [ "bytes", "integer" ]
- convert => [ "response", "integer" ]
- }
- }
- stdin :
- 192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] "POST //render HTTP/1.1" 200 3749 "http://graphite/grafana/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36"
- logs :
- filter received {:event=>{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template"}, :level=>:debug, :file=>"(eval)", :line=>"21"}
- Running grok filter {:event=>#<LogStash::Event:0x5be4b515 @accessors=#<LogStash::Util::Accessors:0x42ca4d5 @store={"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access"}, @lut={"host"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access"}, "host"], "type"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access"}, "type"]}>, @data={"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access"}, @cancelled=false>, :level=>:debug, :file=>"logstash/filters/grok.rb", :line=>"280"}
- Event now: {:event=>#<LogStash::Event:0x5be4b515 @accessors=#<LogStash::Util::Accessors:0x42ca4d5 @store={"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, @lut={"host"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "host"], "type"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "type"], "message"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "message"], "clientip"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "clientip"], "ident"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "ident"], "auth"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "auth"], "timestamp"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "timestamp"], "verb"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "verb"], "request"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "request"], "httpversion"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "httpversion"], "response"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "response"], "bytes"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "bytes"], "referrer"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "referrer"], "agent"=>[{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, "agent"]}>, @data={"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>"200", "bytes"=>"3749", "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, @cancelled=false>, :level=>:debug, :file=>"logstash/filters/grok.rb", :line=>"300"}
- Date filter: received event {:type=>"apache_access", :level=>:debug, :file=>"logstash/filters/date.rb", :line=>"178"}
- Date filter looking for field {:type=>"apache_access", :field=>"timestamp", :level=>:debug, :file=>"logstash/filters/date.rb", :line=>"181"}
- Failed parsing date from field {:field=>"timestamp", :value=>"30/Oct/2014:11:55:08 +0100", :exception=>java.lang.IllegalArgumentException: Invalid format: "30/Oct/2014:11:55:08 +0100" is malformed at "Oct/2014:11:55:08 +0100", :level=>:warn, :file=>"logstash/filters/date.rb", :line=>"213"}
- output received {:event=>{"message"=>"192.168.1.203 - - [30/Oct/2014:11:55:08 +0100] \"POST //render HTTP/1.1\" 200 3749 \"http://graphite/grafana/\" \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\"", "@version"=>"1", "@timestamp"=>"2014-10-30T10:57:16.185Z", "host"=>"template", "type"=>"apache_access", "clientip"=>"192.168.1.203", "ident"=>"-", "auth"=>"-", "timestamp"=>"30/Oct/2014:11:55:08 +0100", "verb"=>"POST", "request"=>"//render", "httpversion"=>"1.1", "response"=>200, "bytes"=>3749, "referrer"=>"\"http://graphite/grafana/\"", "agent"=>"\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2046.0 Safari/537.36\""}, :level=>:debug, :file=>"(eval)", :line=>"82"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement