Splunk Search

max after stats, chart

jrodriguezap
Contributor

Hi, I have a result that comes from: search ... | stats count by MB

MB   count
3.1   4
2.8   2
3.6   1
2.3   5
3.5   1

I would get the count value has more:

MB   count
2.3   5

With that it would be possible?
I appreciate your help.
Greetings.

Tags (2)
0 Karma
1 Solution

sowings
Splunk Employee
Splunk Employee

In this case, I would set up a new field with eventstats (it leaves the original set alone), and then search for where they're equal:


YOUR_SEARCH_HERE | stats count by MB | eventstats max(count) AS max | where count=max

View solution in original post

sowings
Splunk Employee
Splunk Employee

In this case, I would set up a new field with eventstats (it leaves the original set alone), and then search for where they're equal:


YOUR_SEARCH_HERE | stats count by MB | eventstats max(count) AS max | where count=max

jrodriguezap
Contributor

Thank you. I was of help, I had to add the same for the MB column, because when he heard the count for several MB, leaving several.

...| stats count by MB | eventstats max(count) AS maxCount | where count=maxCount | eventstats max(MB) AS maxMB| where MB=maxMB | fields MB
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 ...