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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...