Splunk Search

What Splunk query monitors for an expected event?

Oerstier
New Member

A microservice converts incoming records (logged as events) and must perform this conversion within 5 minutes. The output is also logged as an event for each successful conversion. I want to write a Splunk query that monitors all incoming records have an output event within this time limit. What Splunk query can monitor this? The recordID is logged in Splunk for both events under normal circumstances.

Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Search for the incoming and output events and then have Splunk match them up by recordID. This query looks for 2 events with the same recordID that are more than 5 minutes apart or a single event that arrived more than 5 minutes ago.

<your search for the events> | stats range(_time) as duration, count,, latest(_time) as recent by recordID | where (count==2 AND duration > 300) OR (count==1 AND recent < relative_time(now(), "-5m")
---
If this reply helps you, Karma would be appreciated.
0 Karma

inventsekar
SplunkTrust
SplunkTrust

I assume, your app logs the event to a log file, you monitor ingested that log file to splunk. If yes, then you can write a query to see if the file gets updated every 5 mins.
Is this above assumption are correct, if not, update us more info. Thanks

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...