Reporting

How to find the expected frequency of an index?

POR160893
Builder

Hi,

I am writing a query here to calculate the expected frequency of data in an index :

index=ABC
| eval time_diff=_time-lag(_time)
| stats avg(time_diff) as avg_time_diff

 

However, when I try and run it, I receive the following error message:

 
Error in 'eval' command: The 'lag' function is unsupported or undefined.
The search job has failed due to an error. You may be able view the job in the Job Inspector.
 
Can you please help?
Labels (4)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

gcusello
SplunkTrust
SplunkTrust

Hi @POR160893,

sorry: where did you find the lag function?

what do you want to calculate with it?

Ciao.

Giuseppe

POR160893
Builder

I assumed Splunk has a lag function. I use it quiet a lot in my SQL queries. I need it to calculate  the time difference between each event and the previous event. This is because I would then alculats the average value of the "time_diff" field, giving you an estimate of the expected frequency of data in the index.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @POR160893,

yes there's this function, it's "delta" (https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Delta)

Ciao.

Giuseppe

POR160893
Builder

Thanks, I changed my query to this then:

POR160893_0-1676034604038.png

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @POR160893,

if one answer solves your need, please accept one answer for the other people of Community or tell me how I can help you.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

Get Updates on the Splunk Community!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out >> As our brave ...