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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...