Created
October 31, 2017 00:40
-
-
Save fefore/25f731c047d10854a0f5d697c38de6f5 to your computer and use it in GitHub Desktop.
[LOGSTASH] Grok pattern for AWS ELB Application Logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter { | |
if [type] == "elb-l7" { | |
grok { | |
match => [ "message", "%{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:elb} %{IP:clientip}:%{INT:clientport:int} (?:(%{IP:backendip}:?:%{INT:backendport:int})|-) %{NUMBER:request_processing_time:float} %{NUMBER:backend_processing_time:float} %{NUMBER:response_processing_time:float} (?:-|%{INT:elb_status_code:int}) (?:-|%{INT:backend_status_code:int}) %{INT:received_bytes:int} %{INT:sent_bytes:int} \"%{ELB_REQUEST_LINE}\" \"(?:-|%{DATA:user_agent})\" (?:-|%{NOTSPACE:ssl_cipher}) (?:-|%{NOTSPACE:ssl_protocol})" ] | |
} | |
date { | |
match => [ "timestamp", "ISO8601" ] | |
} | |
mutate { | |
remove_field => [ "message", "timestamp" ] | |
} | |
geoip { | |
source => "clientip" | |
} | |
mutate { | |
update => { | |
"type" => "elb-l7-log" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works pretty well. Thanks
I've removed the part where original message field was removed (just personal thing)