Splunk Search

How to query a string log value based on another string value?

jaj
Path Finder

How can I query for string1val but make sure that stringval2!=0?

I tried something like this but new to splunk.

source=*/thelog.log stringVal1=0 where stringVal2!=0 | stats count

Tags (2)
0 Karma
1 Solution

linu1988
Champion
source=*/thelog.log (stringVal1=0 AND stringVal2!=0) | stats count

View solution in original post

0 Karma

linu1988
Champion
source=*/thelog.log (stringVal1=0 AND stringVal2!=0) | stats count
0 Karma

somesoni2
Revered Legend

Are you looking for a query to search for one string and ensure that other string is not found? If yes then try something like this

source=yoursource "string1Val" NOT "string2Val"

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...