Splunk Search

How to obtain the highest daily traffic flow data that hour

flora123
Path Finder

hi!
I want to get the highest daily traffic by day, so I try this as below

... | convert timeformat="%Y/%m/%d" ctime(_time) as Date | stats count as c by` Date,date_hour | sort 1 - c

But the num of sort can't use a variable

If I use this

... | convert timeformat="%Y/%m/%d" ctime(_time) as Date | stats count as c by Date,date_hour | stats max(c) as MAX by Date

I can't get the date_hour...

I want to get the result as..

Date  date_hour c
2013/8/13 15 100
2013/8/14 1  111
2013/8/15 6  91

Can someone help me find how to deal with it?

Thank you a lot. m(_ _)m

Tags (1)
0 Karma

richnavis
Contributor

...| stats max(c) as MAX Values(date_hour) by Date

0 Karma

flora123
Path Finder

hi mavis.
Thanks for your advice.
but i want to get one highest hour by every day.just like the sample result.
Values will show all hour......thanks a lot~m(_ _)m

0 Karma

Ayn
Legend

Why not use timechart?

... | timechart span=1h count

flora123
Path Finder

hi kristian.
I got it!Thank you very much~~!

0 Karma

flora123
Path Finder

hi Ayn.
Thanks for your advice.
I've tried, but the result is not what I want.it show the count of every hour,but i just want to get the highest......thanks a lot~m(_ _)m

0 Karma

kristian_kolb
Ultra Champion

or a

... | eval Date = strftime(_time, "%Y/%m/%d")| top 1 date_hour by Date | fields - percent

/K

Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes & Cloud Monitoring with Splunk IM

Ready to master Kubernetes and cloud monitoring like the pros? Join Splunk’s Growth Engineering team on ...

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...