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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...