Splunk Search

How to extract "seconds" and "documents" fields from each event, chart the average of seconds/document, and alert if the average is greater than 1?

MikeBertelsen
Communicator

Trying to get an alert from Splunk when an average for a specified time and number of documents > 1.
Example taken for this event:
TIME TAKEN : 2.59 second(s) , NO OF DOCS : 3

2.59/3 =.86333 seconds per document

We want to track if the value is 1 second per document.
Once we have that, if the trend is that this value continues to climb over, we want another alert to warn us of a potential memory leak.

Any help appreciated.

0 Karma

woodcock
Esteemed Legend

Try this:

| rex "TIME TAKEN : (?<seconds>\S+).*NO OF DOCS : (?<documents>\d+)" | eval docsPerSecond = documents/seconds | where docsPerSecond > 1 | timechart span=1h avg(docsPerSecond)
0 Karma

chimell
Motivator

Hi MikeBertelsen
Run the query that Woodcock gave you . Save it as alert by filling the important field

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...