Splunk Search

Event correlation with specific event filtering

strangelaw
Explorer

I have following search:

index=pfsense OR index=otherindex verdict=pass | stats values(destip) AS fieldA, values(otherfield) AS fieldB, values(_time) as fieldC | mvexpand fieldA | mvexpand fieldC | eval matching=if(match(fieldA,fieldB),"1","0") | where matching > 0 | eval fieldC=strftime(fieldC,"%d/%m/%y %H:%M:%S") | table fieldA, fieldB, fieldC, verdict | rename verdict AS "Firewall verdict", fieldA AS "Destination IP", fieldB AS "otherfield", fieldC AS "Event time"

My problem is that verdict (as pass or block) which should be per search now only for "pass" does not follow till table. If I remove the verdict - it works, just without telling to select only passed events. The fields do exist.

Any idea how to make search working so that I can filter the whole search by verdict?

0 Karma
1 Solution

poete
Builder

Hello, did you try this?

index=pfsense OR **(**index=otherindex **AND** verdict=pass**)** | stats values(destip) AS fieldA, values(otherfield) AS fieldB, values(_time) as fieldC | mvexpand fieldA | mvexpand fieldC | eval matching=if(match(fieldA,fieldB),"1","0") | where matching > 0 | eval fieldC=strftime(fieldC,"%d/%m/%y %H:%M:%S") | table fieldA, fieldB, fieldC, verdict | rename verdict AS "Firewall verdict", fieldA AS "Destination IP", fieldB AS "otherfield", fieldC AS "Event time"

View solution in original post

0 Karma

poete
Builder

Hello, did you try this?

index=pfsense OR **(**index=otherindex **AND** verdict=pass**)** | stats values(destip) AS fieldA, values(otherfield) AS fieldB, values(_time) as fieldC | mvexpand fieldA | mvexpand fieldC | eval matching=if(match(fieldA,fieldB),"1","0") | where matching > 0 | eval fieldC=strftime(fieldC,"%d/%m/%y %H:%M:%S") | table fieldA, fieldB, fieldC, verdict | rename verdict AS "Firewall verdict", fieldA AS "Destination IP", fieldB AS "otherfield", fieldC AS "Event time"
0 Karma

poete
Builder

( is a bold parenthesis)

0 Karma

strangelaw
Explorer

yepyep, this is now working. Thanks!

0 Karma
Get Updates on the Splunk Community!

Splunk Smartness with Brandon Sternfield | Episode 3

Callie Skokos: Hello and welcome to another episode of "Splunk Smartness," the interview series where we ...

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...