Splunk Search

How to get top 10 stats with pivot command without using sort?

Simon
Contributor

Hi all,

How can I get a top 10 statistic with pivot? Currently I'm doing something like

| pivot MyModel MyObject count(MyObject) AS count SPLITROW myseries | sort 10 - count 

I'd like to avoid the sort somehow.

Thanks,
Simon

Tags (2)

dfigurello
Communicator

Hi Simon,

Try this search:

| pivot MyModel MyObject count(MyObject) AS count SPLITROW myseries | sort - count | head 10

tks!

bhawkins1
Communicator

I downvoted this post because doesn't answer the question at all.

0 Karma

Simon
Contributor

This is the same as my search does.
I asked if there's a way to get the top10 statistics directly with the pivot command.

0 Karma

spammenot66
Contributor

@simon what in the world are you trying to get at? Both solution seems to work when handling pivot

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...