Splunk Search

Select a row based on highest value of a field.

KarunK
Contributor

Hi All,

I have a table like below (raw table), which shows count of request per 4 hours from two services over a period of two days. I need to find the count values of ServiceA and ServiceB on each day, when the combined request is at peak per day. That will be the values below.

Peak values:-

1/01/2014 4:00  56  89  145
2/01/2014 8:00  56  78  134

Raw Table:-

_time   ServiceA    ServiceB    Total
1/01/2014 0:00  45  56  101
1/01/2014 4:00  56  89  145
1/01/2014 8:00  78  54  132
1/01/2014 12:00 41  11  52
1/01/2014 16:00 23  23  46
1/01/2014 20:00 56  58  114
2/01/2014 0:00  38  56  94
2/01/2014 4:00  54  41  95
2/01/2014 8:00  56  78  134
2/01/2014 12:00 11  23  34
2/01/2014 16:00 23  45  68
2/01/2014 20:00 58  56  114
3/01/2014 0:00  80  49  129

Any ideas how to do it ???

Regards

KK

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

Try this

yoursearchhere
| eval the_date=strftime(_time,"%x")
| eventstats max(total) as MaxTotal by the_date
| where Total=MaxTotal

HTH

View solution in original post

lguinn2
Legend

Try this

yoursearchhere
| eval the_date=strftime(_time,"%x")
| eventstats max(total) as MaxTotal by the_date
| where Total=MaxTotal

HTH

KarunK
Contributor

Thank You !!! Appreciate that.

0 Karma

akocak
Contributor

thanks from year 2020 🙂

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