Splunk Search

Split 'head' by a field?

zkelemen
Explorer

I want to limit a search with head, but do that split by a field: i.e. I want to limit my search to one result only ... per host, for example.

The caveat is, that the log entries are obviously not in order (so for example i may have 3 entries from host1, 2 entries from host2 and only one from host3) so doing something like head 3 for 3 hosts would not do it.

Tags (3)
1 Solution

ziegfried
Influencer

You can use the dedup command:

... | dedup host

View solution in original post

ziegfried
Influencer

You can use the dedup command:

... | dedup host

zkelemen
Explorer

exactly what I was looking for, thanks.

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 ...