Reporting

How to not send out empty report file when there is no data in the report file?

zliu
Splunk Employee
Splunk Employee

Needs to send out reports every hour to an external entity and try to figure out how to have some default values set when there is no data for that time range instead of sending an empty report. The query is below:

eventtypes=TIC-FW-NETSCREEN earliest="-1h@h" latest=@h | stats max(deviceclass) as DeviceClass count(_raw) AS Count last(_time) AS FirstRecord first(_time) as LastRecord | convert ctime(FirstRecord) | convert ctime(LastRecord) | outputcsv filename.csv

Desired Output when there are no records for the search:

DeviceClass,Count,FirstRecord,LastRecord FIREWALL,0,"01/01/1970 00:00:00","01/01/1970 00:00:00"

Tags (1)

dolivasoh
Contributor

You could try using fillnull to populate the blank report with some default data like referenced above.

Or maybe take a look at filldown which will fill null values with the last value in the index.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...