Skip to content

Commit

Permalink
add more grok rule for http request
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin-Sun-tts committed Dec 28, 2023
1 parent 6718f2b commit e2e8c76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion logstash/logstash.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ filter{
}
grok {
match => {
"log_data" => '%{HOSTNAME:hostname} - \[%{TIMESTAMP_ISO8601:timestamp}\] %{GREEDYDATA:http_request} "-" %{QUOTEDSTRING:http_user_agent} ".*" ".*" x_forwarded_for:"(?:%{IPORHOST:forwarded_ips}(?:, %{IPORHOST:forwarded_ips})*)" .*'
"log_data" => '%{HOSTNAME:hostname} - \[%{TIMESTAMP_ISO8601:timestamp}\] "%{WORD:http_method} %{GREEDYDATA:request_uri} %{DATA:http_version}" %{NUMBER:http_status} %{NUMBER:response_size} %{NUMBER:response_time} %{QUOTEDSTRING:http_user_agent}? %{QUOTEDSTRING:http_user_agent} ".*" ".*" x_forwarded_for:"(?:%{IPORHOST:forwarded_ips}(?:, %{IPORHOST:forwarded_ips})*)" .*'
tag_on_failure => []
overwrite => ["message"]
break_on_match => false
Expand All @@ -92,6 +92,7 @@ filter{
mutate {
add_field => { "[@metadata][NEWRELIC_KEY]" => "${NEWRELIC_LICENSE_KEY:notpresent}" }
add_field => { "[@metadata][AWS_S3_PROXY]" => "${AWS_S3_PROXY:notpresent}" }
remove_field => ["skip"]
}

}
Expand Down

0 comments on commit e2e8c76

Please sign in to comment.