Splunk Search

How can I report on only current data in a file being refreshed every minute?

bcarnot
Path Finder

A file is being referenced, that is updated every minute.
I would like to report on data that only exists in that file for the last minute.

Background: The data in the file is for outage events. When an outage occurs, the data has the estimated restoration time.
If the outage is restored, the data no longer exists on this file.

Right now I am I am keying off of the restoration value in the file. Using this logic is not accurate, because in most cases the outage has been restored before the estimated restoration.

|eval completed_time=strptime(ert, "%Y-%m-%dT%H:%M:%S") | eval now=now() | where completed_time>now

What is happening is the data does not fall off the dashboard till the restoration time is past present time.

How can I report only on data that exists in this file? Again the file is refreshed every minute with only current outage data.

Appreciate your time and thoughts.

0 Karma
1 Solution

somesoni2
Revered Legend

You can use the _index_earliest and _index_latest relative timerange specifier to only use the data indexed in last minutes. Based on how the timestamp appears on your data, you may need to use a large time range period so that all data is included. Try like this

your base search _index_earliest=-1m@m _index_latest=@m | rest of the search

See more info on timerange modifier here: https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/SearchTimeModifiers

View solution in original post

0 Karma

somesoni2
Revered Legend

You can use the _index_earliest and _index_latest relative timerange specifier to only use the data indexed in last minutes. Based on how the timestamp appears on your data, you may need to use a large time range period so that all data is included. Try like this

your base search _index_earliest=-1m@m _index_latest=@m | rest of the search

See more info on timerange modifier here: https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/SearchTimeModifiers

0 Karma

bcarnot
Path Finder

This works perfect and thank you for the link.
Thank you!

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...