Splunk Search

How do I group time values together by another field?

andrewking1116
Engager

I'm trying to get my table to group events by Source IP. The search counts the number web traffic hits by Source IP and groups them into 1 hour time frame. I want to then have each Source IP as a single event and also show all the hour time spans that that IP was seen.

Current:

Time               Count   IP             
2016-06-02 14:00   3500    1.1.1.1      
2016-06-02 16:00   3000    1.1.1.1      
2016-06-02 15:00   3000    2.2.2.2  

What I want:

Time               Count   IP
2016-06-02 14:00   6500 1.1.1.1      
2016-06-02 16:00
2016-06-02 15:00   3000    2.2.2.2    
0 Karma
1 Solution

sundareshr
Legend

Try this

... | bin span=1d _time | stats values(_time) as Time sum(count) count by IP | table Time count IP 

View solution in original post

sundareshr
Legend

Try this

... | bin span=1d _time | stats values(_time) as Time sum(count) count by IP | table Time count IP 

andrewking1116
Engager

Thank you for your quick response. I thought I had tried that but must have use value instead of values.

0 Karma

ppablo
Retired

HI @andrewking1116

If @sundareshr's answer solved your question, please don't forget to resolve the post by clicking "Accept" directly below his answer. Also give him an upvote for helping you out 🙂

Patrick

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