Reporting

Can one generate a report with a "N/A" entry if no data found, but with real data if present

Gawker
Path Finder

I can generate an incident report by server that looks like this:

Host_Name Event_Count
myhost-01 11
myhost-02 2

If there isn't any data for the observation period, I want to generate something like this:

Host_Name Event_Count
n/a 0

I've tried using several eval and fillnull statements to get past this. Example:

       ...| stats sum(linecount) as Total_Events BY host | fillnull host value="N/A"

Thank you.

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

...| stats sum(linecount) as Total_Events BY host | appendpipe [| stats count | where count=0 | rename count as Total_Events | eval host="N/A" | table host Total_Events]

View solution in original post

0 Karma

somesoni2
Revered Legend

Try like this

...| stats sum(linecount) as Total_Events BY host | appendpipe [| stats count | where count=0 | rename count as Total_Events | eval host="N/A" | table host Total_Events]
0 Karma

Gawker
Path Finder

Works great. Thank you for the solution and insight.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...