Splunk Search

List of events from transactions starting with A

daisy_st
Loves-to-Learn Everything

Hi all,

I am using data from 3 different indexes. They contain events which can be attributed to specific transactions through ID. There are multiple transactions and each transaction contains event from multiple indexes. The transaction can look like 1) event from index 1, 2) event from index 2, 3) event from index 1, etc. I would like to get only events for which the transaction starts with A and ends with B or C. I was thinking to use transaction but it would be way too slow to get the events. I was trying to work out with stats but I end up getting all events, not only the events that start with A and end with B or C.  The result should be also list of events, i.e. no chart or visualizations. Any ideas?

 

(index=x) OR (index=y) OR (index=z)
| stats list(*) as * by ID Time   | fields - a,b,c

 

Labels (2)
0 Karma

daisy_st
Loves-to-Learn Everything

hi, I actually found another workaround. The point was to get the specific status as part of each transaction included transaction and afterwards getting the data back in raw event format with matching events only. For example, all events for transactions which contain ERROR code need to be displayed, even if the given event doesn't contain the code but the transaction does. Thanks for making me check further eventstats, that helped.

index=x OR index=y OR index=z 
| eventstats count(eval(Status="A")) AS Count_Status list(Status) AS VALUES min(_time) AS min_time  BY  ID| where Count_Status>0  

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
(index=x) OR (index=y) OR (index=z)
| eventstats first(index) as lastindex last(index) as firstindex by ID
| where firstindex=x and (lastindex=y or lastindex=z)

Assumes events are latest first

0 Karma
Get Updates on the Splunk Community!

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...
OSZAR »