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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...