Splunk Search

Is there a way to group by multiple fields in a timechart?

daniel333
Builder

All,

I am looking to create a single timechart which displays the count of status by requestcommand by action. So two "by's". Maybe I should compound the field?

tag=myrest "https://api.mydomain.net/somemethod/listings/*" host=MYHOST*
| rex field=_raw "action=(?<requestcommand>RELEASE|HOLD|EXTEND|PURCHASE)"
| rename event.Properties.LogEntry.ResponseStatusCode AS status
| search status=*
| timechart count(status) by action, requestcommand
0 Karma

mayurr98
Super Champion

Try this :

tag=myrest "https://api.mydomain.net/somemethod/listings/*" host=MYHOST* 
| bin _time span=5m \\specify time span 
| rex field=_raw "action=(?<requestcommand>RELEASE|HOLD|EXTEND|PURCHASE)" 
| rename event.Properties.LogEntry.ResponseStatusCode AS status 
| search status=* 
| stats count(status) as status_count by _time action requestcommand

Let me know if this helps!

0 Karma

somesoni2
Revered Legend

Yes.. combine the field before your timechart command.

...| eval action_rcommand=action.":".requestcommand
| timechart count(status) by action_rcommand
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...