Splunk Search

select query based on unique id

anshumishra
New Member

Hi,
I have a log where the, app logs the various steps for a unique opertaion id (id below) ->
......
ts=1318861839975,name=stepOne,type=typeOne,id=a30a2286-1318861839810
ts=1318861845825,name=stepTwo,type=typeOne,id=a30a2286-1318861839810
......

It is possible that the stepTwo is not logged in case of some failure or there may be more failure steps (say stepThree), which we want to discard.
How can I do a select query, so that only the entries(id) which have both the steps (stepOne and stepTwo) logged, are displayed ?

Tags (2)
0 Karma

Ayn
Legend

Use transaction to combine events with the same id, then search for transactions that have both the values "stepOne" and "stepTwo" in the name field.

... | transaction id | search name="stepOne" AND name="stepTwo"

Ayn
Legend

Awesome! Could you please mark my answer as accepted? That way it will be shown clearly on the site that you got the help you needed for this question. Thanks!

0 Karma

anshumishra
New Member

Thanks Ayn !
That is what I wanted.I am new to this stuff, so I'll probably be asking some simple stuffs (after searching through the forum ofcourse), till I get hold of it.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...