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!

Enhance Your Splunk App Development: New Tools & Support

UCC FrameworkAdd-on Builder has been around for quite some time. It helps build Splunk apps faster, but it ...

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...