Dashboards & Visualizations

Filtering the events excluding certain word from regex

deepak_93
Engager

I need to filter the event which does not contain word "error".

For example, I have events containing-
"POST /operation/requiredword" 
"POST /operation/requiredword | error".

I want to count only the "POST /operation/requiredword" and exclude the "POST /operation/requiredword | error".

Here is the query I am using right now and it is giving me both the events with and without containing "error":

index="depat-test-app"
| rex "DN: (?<ConsumingApp>.*?)[}\s]"
| rex field=_raw "(?<Passed>(POST \/opertion\/requiredword))
| stats count(passed) by ConsumingApp

 

What I want is something like this:

index="depat-test-app" | rex "DN: (?<ConsumingApp>.*?)[}\s]" | rex field=_raw "(?<Passed>(POST \/operation\/requiredword NOT error )) | stats count(passed) by ConsumingApp
Labels (1)
0 Karma

vnravikumar
Champion

Hi

Try this

| makeresults 
| eval test="\"POST /operation/requiredword\",\"POST /operation/requiredword | error\"" 
| makemv delim="," test 
| mvexpand test 
| regex test!="(\| error)"
0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...