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!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...