Splunk Search

How to add a column showing search criteria that matched results?

quadrant8
New Member

I'm writing a search to parse the command line arguments of 4688 events, and want to be able to sort by what matched in my search criteria.

The arguments I'm searching for don't have a set order they appear in, so it's a mess to try and write regex to parse what the result hit on.

Is there any way to add a column to the result table that shows what search criteria the result hit on?

0 Karma

begleyj1
Path Finder

If you have the windows TA, the process command line field should be extracted automatically as the field Process_Command_Line. If not, you can use the rex command and group off of that.

...| rex field=_raw "Process Command Line: (?<Command_Line>[^\n]+)" | stats count by Command_Line
0 Karma

nabeel652
Builder

can you post your search and the search criteria you are using?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...