Hi. I'm trying to make a 'dynamic' parsing of a URL by this grok pipeline.
if [container][image][name] =~ /nginx/ {
grok{
match => { "message" => ["%{IPORHOST:[nginx][access][remote_ip]} - %{DATA:[nginx][access]
[user_name]} \[%{HTTPDATE:[nginx][access][time]}\] \"%{WORD:[nginx][access][method]} %
{DATA:[nginx][access][url]} HTTP/%{NUMBER:[nginx][access][http_version]}\" %{NUMBER:
[nginx][access][response_code]} %{NUMBER:[nginx][access][body_sent][bytes]} \"%{DATA:
[nginx][access][referrer]}\" \"%{DATA:[nginx][access][agent]}\""] }
remove_field => "message"
if [nginx][access][url] != "/" { match => { "nginx.access.url" => ["%{GREEDYDATA:uri_stem}\?%
{GREEDYDATA:uri_query}"] } }
}
}
For some reason, it doesn't work and I don't know why. Help me, please. The condition in the grok is because a URL with / only won't display.