Splunk Search

How do i filter out all but the most recent results for a particular field

musgrape
Engager

I'd like to create a search that allows me to filter out all the old results and only give me back the latest result for a given field value.
How can I do this? (similar to the latest in the stats command but for the actual results)

For example given the following results:
2015-05-01 Version:1.34 user:b
2015-04-01 Version:1.2 user:a
2015-03-03 Version: 1.34 user:a
2015-02-03 Version: 1.2 user:b

I only want to see the following:
2015-04-01 Version:1.2 user:a
2015-05-01 Version:1.34 user:b

i.e. I only want to see the latest version per user.

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

... | dedup user

View solution in original post

cmeinco
Path Finder
0 Karma

woodcock
Esteemed Legend

Like this:

... | dedup user

musgrape
Engager

Perfect thanks. This worked for me:
dedup user sortby -_time | table...

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...