Splunk Search

Extract InProgress Transaction

manvi_spl8
New Member

I want to filter out transactions(where status ="InProgress ") that started in the previous slot and those completed in the next slot. basically if earliest=04/27/2021:12:0:0 and latest=04/28/2021:12:0:0 I want to display only those transactions which started in the specified period and are in completed status.

I have a previous query like this :

stats earliest(_time) as InTime ,latest(_time) as OutTime,

values(eval(if(code="E100" OR code="E101" OR code="E102"))) as error,

count(eval(code="E010")) as messageReceived, count(eval(code="E030" OR code="E031")) as messageCompleted | sort - InTime

Labels (2)
Tags (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What defines a transaction? Do all the events for a transaction have the same unique correlation id?

0 Karma

manvi_spl8
New Member

All the transactions have unique Id

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming code=E010 is your start and either E101 or E102 is your end, gather all the codes for the transaction on each event and then search for the events which have E010 and either E101 or E102, then calculate your stats from these events.

| eventstats values(code) as allcodes by transactionid
| search allcodes="E010" (allcodes="E030" OR allcodes="E031")
| stats earliest(_time) as InTime ,latest(_time) as OutTime,
values(eval(if(code="E100" OR code="E101" OR code="E102"))) as error,
count(eval(code="E010")) as messageReceived, count(eval(code="E030" OR code="E031")) as messageCompleted | sort - InTime
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...