Splunk Search

Taking Value of One Field, Adding Text, And Comparing Against Another Field

SplunkLunk
Path Finder

Greetings,

I want to exclude search results if a field contains a value compared against another field with additional text added.  So it would look something like this:

Field1=value

Field2=Field1+[text]

Field3=[value2]

Exclude results where Field2=Field1+[text] and Field3=[value2]

Can anyone tell me what the syntax in Splunk would be?  Thanks.

Labels (3)
0 Karma

shivanshu1593
Builder

Hello @SplunkLunk ,

Please try something like this:

| your base query

| eval match_field = if(match(field2,"regex to match the values that you want to find", "Match","No Match"))

| where NOT (match_field="Match" AND Field3=[value2])

| rest of your query

 

Hope this helps.

Thanks,

S

 

***If it helped, Please accept it as an answer. It helps others to find the solutions to similar problems quickly***

Thank you,
Shiv
###If you found the answer helpful, kindly consider upvoting/accepting it as the answer as it helps other Splunkers find the solutions to similar issues###
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...