Splunk Search

Data file

suraj44
Engager

I have a data file , this source file does not contain any data on most days .. Its a valid scenario only . But since it does not have any data my panel in dashboards shows "" No results found"

 

index="xyz" source="*RatedUsg_OutSeq.dat" | eventstats max(Extract_Time) AS most_recent | where (Extract_Time = most_recent) | table Extract_Time File_Name File_Sequence Source_System_Key.

 

i am new to Splunk . My requirment is on those days where .dat file is empty it should dispaly a message "No Records Today" on other days that particular query should work.

 

Please help .I needed it to procced further .

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The appendpipe command can do that.

index="xyz" source="*RatedUsg_OutSeq.dat" 
| eventstats max(Extract_Time) AS most_recent 
| where (Extract_Time = most_recent) 
| appendpipe [ stats count | eval File_Name = "No Records Today" | where count = 0 | fields - count ]
| table Extract_Time File_Name File_Sequence Source_System_Key
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The appendpipe command can do that.

index="xyz" source="*RatedUsg_OutSeq.dat" 
| eventstats max(Extract_Time) AS most_recent 
| where (Extract_Time = most_recent) 
| appendpipe [ stats count | eval File_Name = "No Records Today" | where count = 0 | fields - count ]
| table Extract_Time File_Name File_Sequence Source_System_Key
---
If this reply helps you, Karma would be appreciated.

suraj44
Engager

Thank You so much . It helped

0 Karma
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!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...