Splunk Search

can i insert a default value for results

rakesh_498115
Motivator

Hi,

i have created 5 eventtypes say A,B,C,D and used the chart command to display the count of all the events in the evenntypes on the particular searchlogic..For few searchlogic few eventtypes didnt contain any events..in that case nothing is displaying..I need to display "N/A" to that field instead of displaying blank.

How can i do this..

My search query is something like this ..

sourcetype="X" (somelogic) | chart sum(count) by uniqueId,eventtype

My output is .

UniqueID    A B C D E 
ddd         4    5 5 7
sss            5 4 7 8

I need the output like this.

UniqueID    A     B      C D E 
ddd         4     N/A    5 5 7
sss         N/A   5      4 7 8

Thanx

Tags (1)
1 Solution

Ayn
Legend

Use fillnull to give the fields without a value a predefined value of your own:

... | fillnull value="N/A"

More information on the fillnull command: http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fillnull

View solution in original post

Ayn
Legend

Use fillnull to give the fields without a value a predefined value of your own:

... | fillnull value="N/A"

More information on the fillnull command: http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fillnull

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...