Hi,
I need to parse each field from a McAfee WebGateway like having a field url, ip source, destination... Can you please help me to understand my mistakes with kv and grok? I do not success to make the kv works. Here is what I did:
- Log exemple:
"<30>Apr 3 14:15:55 MWG05 mwg: [03/Apr/2019:14:15:55 +0200]#jean-bombeur#192.168.1.1#13.117.5.81#90#200#TCP_MISS_RELOAD#GET http://api.bing.com/qsml.aspx?query=troll&maxwidth=32765&rowheight=20§ionHeight=160&FORM=IESS02&market=fr-FR HTTP/1.1# #Search Engines, Internet Services# #Minimal Risk# #text/xml#1036#1315#Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko# #-# #-# #0# #0# #-# #-# #-# #GRP-INTERN#"
- part of the Logstash.conf
else if [host] in ["192.168.10.1", "192.168.10.2"] {
# mcafee
grok {
match => ["message", "%{SYSLOG5424PRI}%{GREEDYDATA:data}"]
add_tag => ["REMARQUABLE"]
}
kv {
source => "data"
field_split => "#"
}
}
- Here is the actual result
{
"host" => "192.168.10.1",
"data" => "Apr 3 14:15:55 MWG05 mwg: [03/Apr/2019:14:15:55 +0200]#jean-bombeur#192.168.1.1#13.117.5.81#90#200#TCP_MISS_RELOAD#GET http://api.bing.com/qsml.aspx?query=troll&maxwidth=32765&rowheight=20§ionHeight=160&FORM=IESS02&market=fr-FR HTTP/1.1# #Search Engines, Internet Services# #Minimal Risk# #text/xml#1036#1315#Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko# #-# #-# #0# #0# #-# #-# #-# #GRP-INTERN#",
"GET http://api.bing.com/qsml.aspx?query" => "troll&maxwidth=32765&rowheight=20§ionHeight=160&FORM=IESS02&market=fr-FR HTTP/1.1",
"message" => "<30>Apr 3 14:15:55 MWG05 mwg: [03/Apr/2019:14:15:55 +0200]#jean-bombeur#192.168.1.1#13.17.5.81#90#200#TCP_MISS_RELOAD#GET http://api.bing.com/qsml.aspx?query=troll&maxwidth=32765&rowheight=20§ionHeight=160&FORM=IESS02&market=fr-FR HTTP/1.1# #Search Engines, Internet Services# #Minimal Risk# #text/xml#1036#1315#Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko# #-# #-# #0# #0# #-# #-# #-# #GRP-INTERN#",
"type" => "mcafee",
"@version" => "1",
"@timestamp" => 2019-04-03T12:01:19.026Z,
"tags" => [
[0] "REMARQUABLE"
],
"syslog5424_pri" => "30"
}