Guest User

Untitled

a guest
Oct 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. filter {
  2. if [type] == "cloudfront" {
  3. if ( ("#Version: 1.0" in [message]) or ("#Fields: date" in [message])) {
  4. drop {}
  5. }
  6.  
  7. grok {
  8. match => { "message" => "%{DATE_US:date}\t%{TIME:time}\t%{WORD:x_edge_location}\t(?:%{NUMBER:sc_bytes}|-)\t%{IPORHOST:c_ip}\t%{WORD:cs_method}\t%{HOSTNAME:cs_host}\t%{NOTSPACE:cs_uri_stem}\t%{NUMBER:sc_status}\t%{GREEDYDATA:referrer}\t%{GREEDYDATA:User_Agent}\t%{GREEDYDATA:cs_uri_stem}\t%{GREEDYDATA:cookies}\t%{WORD:x_edge_result_type}\t%{NOTSPACE:x_edge_request_id}\t%{HOSTNAME:x_host_header}\t%{URIPROTO:cs_protocol}\t%{INT:cs_bytes}\t%{GREEDYDATA:time_taken}\t%{GREEDYDATA:x_forwarded_for}\t%{GREEDYDATA:ssl_protocol}\t%{GREEDYDATA:ssl_cipher}\t%{GREEDYDATA:x_edge_response_result_type}" }
  9. }
  10.  
  11. mutate {
  12. add_field => [ "received_at", "%{@timestamp}" ]
  13. add_field => [ "listener_timestamp", "%{date} %{time}" ]
  14. }
  15.  
  16. date {
  17. match => [ "listener_timestamp", "yy-MM-dd HH:mm:ss" ]
  18. }
  19.  
  20. date {
  21. locale => "en"
  22. timezone => "UCT"
  23. match => [ "listener_timestamp", "yy-MM-dd HH:mm:ss" ]
  24. target => "@timestamp"
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment