Splunk Search

Get values of several series during same timespan that the maximum of one series during a day

gregory_cordier
Explorer

Hi,

I built a report that list daily maximums and averages of counts per hour on several days. (difficult to put it in phrase..)
Here is the query I use:

<search string>
| bucket _time span=1h 
| stats dc(Serial) as dcSerial, dc(otherserial) as dcOtherSerial by _time 
| bucket _time span=1d 
| eval Processedtime=strptime(_time,"%s") 
| stats max(dcSerial) avg(dcSerial) max(dcOtherSerial) avg(dcOtherSerial) by Processedtime

So this query returns maximums of distinct counts of each fields, which is good.
But what I need is to return the dcOtherSerial has when dcSerial is at the maximum during the day (because I don't care about the maximum of dcOtherSerial, I want to correlate both of them).
Is it understandable ?

any thoughts?

thanks

Tags (2)
0 Karma

to4kawa
Ultra Champion
 <search string>
 | bucket _time span=1h 
 | stats dc(Serial) as dcSerial, dc(otherserial) as dcOtherSerial by _time 
 | bucket _time span=1d 
 | eval Processedtime=strptime(_time,"%s") 
 | eventstats max(dcSerial) avg(dcSerial) max(dcOtherSerial) avg(dcOtherSerial) by Processedtime
 | where as_you_like

use eventstats not stats

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...