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!

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