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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

    Thursday, June 25, 2026  |  11AM PDT / 2PM EDT  Duration: 1 Hour (Includes live Q&A) Register to ...

Analytics Workspace deprecation

As of Splunk Cloud Platform 10.4.2604 and Splunk Enterprise 10.4, Analytics Workspace is now deprecated. ...

Splunk Developer Day Recap: Building, Publishing, and Growing on the Splunk Platform

Splunk Developer Day brought the Splunk developer community together for a practical look at what it means to ...