Splunk Search

Variable number in head command

gesman
Communicator

How can I return calculated (variable) number of top events?
This doesn't work:
... | eval x=5 | head x

Tags (1)
0 Karma
1 Solution

gesman
Communicator

Got it:
... | eval x=5 | streamstats c | where c<=x

View solution in original post

0 Karma

gesman
Communicator

Got it:
... | eval x=5 | streamstats c | where c<=x

0 Karma
Get Updates on the Splunk Community!

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

Introducing the Splunk Community Dashboard Challenge!

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