Splunk Search

Find earliest events by category

Jordan_Brough
Path Finder

I'd like to select the earliest events broken down by category.

i.e. I would like to see something like this:

error | stats earliest(_raw) as earliest_raw by error_category | ...

That pretty much gives me what I need, but it's a little inconvenient that 1) now I have to work off of "earliest_raw" and 2) the event list view doesn't show anything.

Is there a better way? What I'd really like to do is something like:

error | earliest by error_category | ...
Tags (2)
0 Karma
1 Solution

Jordan_Brough
Path Finder

aholzer's answer worked great:

error | dedup category sortby +_time | ...

Thanks!

View solution in original post

0 Karma

Jordan_Brough
Path Finder

aholzer's answer worked great:

error | dedup category sortby +_time | ...

Thanks!

0 Karma

Jordan_Brough
Path Finder

I'm not sure how to use head/tail since I also need to group by category, but dedup:

dedup category sortby +_time

worked like a charm! Thanks!

0 Karma

aholzer
Motivator

You may want to consider using one of the following:
- dedup with a sort by time
error | dedup error_category sort by +_time
- the head command or the tail command depending how you want to look at your events

Just remember that you can perform checks on the field "_time" to get the earliest

Hope this helps

Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...