Splunk Search

How to group by multiple fields?

rsahoo
Engager

I have a data set from where I am trying to apply the group by function on multiple columns. I tried stats with list and ended up with this output.

country state time #travel
India Bangalore
20220326023652
1
   
20220326023652
1
   
20220327023321
1
   
20220327023321
1
   
20220327023321
1

Whereas I am looking for something below ...

country state time #travel
India Bangalore
20220326023652
2
   
20220327023321
3

 

Any suggestions on the right query please!

Labels (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Without a verbal description of the actual requirement, this is my speculation of the intention: country and state are uniquely determined by time, and #travel is added up.

| stats values(country) as country values(state) as state sum("#travel") as "#travel" by time
Get Updates on the Splunk Community!

Set Up More Secure Configurations in Splunk Enterprise With Config Assist

This blog post is part 3 of 4 of a series on Splunk Assist. Click the links below to see the other ...

Observability Highlights | November 2022 Newsletter

 November 2022Observability CloudEnd Of Support Extension for SignalFx Smart AgentSplunk is extending the End ...

Enterprise Security Content Update (ESCU) v3.54.0

The Splunk Threat Research Team (STRT) recently released Enterprise Security Content Update (ESCU) v3.54.0 and ...