All Apps and Add-ons

Search to view one _raw event for each result

browncardigan
Path Finder

I'm in the process of evaluating our log sources to figure out what we should be keeping and how to parse the data to get the results we need.

As an example, looking at Exchange logs, there's an event_id field with results like

RECEIVE
SUBMIT
SEND
DELIVER
AGENTINFO
FAIL
DROP

I want to view one or two raw events for each of the event_id values to see if they're significant enough to keep and/or parse in our searches.

Is there a way to do this? I've tried searching in Splunk Answers but haven't found any questions similar to this one - apologies if I've missed it.

0 Karma
1 Solution

browncardigan
Path Finder

Can't figure out how to select a comment as an answer, but it was provided by @renjith.nair:

For multiple results per event_id:
"your base" | top 10 _raw by event_id

Or just the first result:
"your base" | first(_raw) as raw by event_id

View solution in original post

0 Karma

browncardigan
Path Finder

Can't figure out how to select a comment as an answer, but it was provided by @renjith.nair:

For multiple results per event_id:
"your base" | top 10 _raw by event_id

Or just the first result:
"your base" | first(_raw) as raw by event_id

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@browncardigan ,

Are you looking for something similar to below ?

"your base search"|stats first(_raw) as _raw by event_id
Happy Splunking!

browncardigan
Path Finder

That's a neat workaround, but if possible I'd prefer to get a bigger sample size for each event_id. It doesn't look like either first() or last() take any arguments - I don't suppose you'd know how to get around that?

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

"your base" | top 10 _raw by event_id ?

where 10 can be replaced by any number

Happy Splunking!

browncardigan
Path Finder

Ah, yeah that worked perfectly, thanks so much for your help!

0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...