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

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 ...