Splunk Search

Chart or timechart by multiple values

sherpedz
Loves-to-Learn Lots

I have a chart that I can split by myDate or env, but I cannot get it to split by both myDate and env for example I need to see how many urgency events have taken place on a given myDate by each of the env (environments).

I have used multiple versions of splitting the code and just cannot get this right - any help will be great, this is related to Splunk ES.

`notable`
| eval env=coalesce(src_bunit, dvc_bunit, dest_bunit)
| eval env=upper(env)
| fillnull value="Unknown" env
| search NOT `suppression` AND env=*
| eval myDate=strftime(_time, "%Y-%m-%d")
| chart count by env urgency
| table myDate env critical high medium low informational
| fillnull critical high medium low informational
| rename env AS Environment, critical AS Critical, high AS High, medium AS Medium, low AS Low, informational AS Informational
| addtotals col=true labelfield=Environment label="Total(s)" row=true

Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

chart loses myDate. Try using stats and then create a field with the name for the series and use that for the xyseries. Something like this:

`notable`
| eval env=coalesce(src_bunit, dvc_bunit, dest_bunit)
| eval env=if(like(env,"%tgw%") OR like(env,"%TGW%"),"DCT",env)
| eval env=upper(env)
| fillnull value="Unknown" env
| search NOT `suppression` AND env=*
| eval myDate=strftime(_time, "%Y-%m-%d")
| stats count by myDate env urgency
| eval envurgency=env.":".urgency
| xyseries myDate envurgency count

 

0 Karma
Get Updates on the Splunk Community!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...