127.0.0.1 - - [26/Mar/2016:19:09:19 -0400] "GET / HTTP/1.1" 401 194 "" "Mozilla/5.0 Gecko" "-"
%{IPORHOST:clientip} (?:-|(%{WORD}.%{WORD})) %{USER:ident} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent} %{QS:forwarder}
{
"clientip": [
[
"127.0.0.1"
]
],
"HOSTNAME": [
[
"127.0.0.1"
]
],
"IP": [
[
null
]
],
"IPV6": [
[
null
]
],
"IPV4": [
[
null
]
],
"WORD": [
[
null,
null
]
],
"ident": [
[
"-"
]
],
"USERNAME": [
[
"-"
]
],
"timestamp": [
[
"26/Mar/2016:19:09:19 -0400"
]
],
"MONTHDAY": [
[
"26"
]
],
"MONTH": [
[
"Mar"
]
],
"YEAR": [
[
"2016"
]
],
"TIME": [
[
"19:09:19"
]
],
"HOUR": [
[
"19"
]
],
"MINUTE": [
[
"09"
]
],
"SECOND": [
[
"19"
]
],
"INT": [
[
"-0400"
]
],
"verb": [
[
"GET"
]
],
"request": [
[
"/"
]
],
"httpversion": [
[
"1.1"
]
],
"BASE10NUM": [
[
"1.1",
"401",
"194"
]
],
"rawrequest": [
[
null
]
],
"response": [
[
"401"
]
],
"bytes": [
[
"194"
]
],
"referrer": [
[
""""
]
],
"QUOTEDSTRING": [
[
"""",
""Mozilla/5.0 Gecko"",
""-""
]
],
"agent": [
[
""Mozilla/5.0 Gecko""
]
],
"forwarder": [
[
""-""
]
]
}
to use the quotes in the grok expression its possible to scape with \ before the ". so the filter will look like this:
%{IPORHOST:remoteAddr} (?:-|(%{WORD}.%{WORD})) %{USER:ident} [%{HTTPDATE:timestamp}] "(?:%{WORD:method} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:status} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent} %{QS:forwarder}
and then the config for the pipeline its just