Splunk Search

Display value in chart even if count if zero

treinke
Builder

Looking to do a chart and even if the count of a value is 0 still diplay the name of the value. My search so far is:
sourcetype=app3* (app3_level="Fatal" OR app3_level="Error") | chart count by app3_level,app3_message

I tried to add to the end of the statement but it didn't help.
| fillnull value=0 app3_level

Most of the time there is not a "app3_level=Fatal" but I still want it to show up in the column. Any ideas?

There are no answer without questions
Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

sourcetype=app3* (app3_level="Fatal" OR app3_level="Error") | chart count by app3_level,app3_message  | append [| gentimes start=-1 | eval app3_level="Fatal Error" | table app3_level | makemv app3_level | mvexpand app3_level ] | fillnull value=0 | stats max(*) as * by app3_level,app3_message

View solution in original post

somesoni2
Revered Legend

Try this

sourcetype=app3* (app3_level="Fatal" OR app3_level="Error") | chart count by app3_level,app3_message  | append [| gentimes start=-1 | eval app3_level="Fatal Error" | table app3_level | makemv app3_level | mvexpand app3_level ] | fillnull value=0 | stats max(*) as * by app3_level,app3_message
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...