Hi there!
I'm currently testing the latest PFelk with my firewall and I found a very specific situation which has only happened with a couple of log lines, but I would like to make it work. The problem is that due to some processing (not using grok), certain fields that exist in these log lines don't have a value and therefore the assigned field returns as: [pf][tcp][options] = "%{[pfelk_csv][28]}".
I've tried using the prune filter with all kinds of regex to blacklist values of that form, even hardcoding it for the specific value, but nothing. I'm probably doing something wrong with the regex or I simply don't understand the method.
Ideally, I could add a default value when doing the add_field for [pf][tcp][options]; but in general I would like to avoid using something like 'if [pf][tcp][options] =~ "^%{[+}$"', mostly because there are 22 [pf] fields...
Some more context:
The part of pfekl that manages these logs is "02-firewall.pfelk" and processes the log field by field instead of simply using grok.
filter {
### filterlog ###
if [log][syslog][appname] =~ /^filterlog$/ {
.......
mutate {
split => { "pfelk_csv" => "," }
}
...........
if [network][protocol] == "tcp" {
mutate {
add_field => {
.......
"[pf][tcp][window]" => "%{[pfelk_csv][26]}"
"[pf][tcp][urg]" => "%{[pfelk_csv][27]}"
"[pf][tcp][options]" => "%{[pfelk_csv][28]}"
}
}
}
}
The input log looks like this:
<134>May 14 04:41:52 test.host filterlog: 5,,,1000000103,lagg1.232,match,block,in,4,0x0,,241,56358,0,none,6,tcp,40,8.8.8.8,9.9.7.7,43620,51497,0,S,3713913524,,1024,,