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
Legend

@browncardigan ,

Are you looking for something similar to below ?

"your base search"|stats first(_raw) as _raw by event_id
---
What goes around comes around. If it helps, hit it with Karma 🙂

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
Legend

"your base" | top 10 _raw by event_id ?

where 10 can be replaced by any number

---
What goes around comes around. If it helps, hit it with Karma 🙂

browncardigan
Path Finder

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

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...