Getting Data In

How can I find out the max indexing delay, maybe by using the tstats command?

danielbb
Motivator

I would like to find out the max indexing delay per index.

| tstats max(_indextime - _time) where index=* by index

Throws the error -
-- Error in 'stats' command: The aggregation specifier 'max(_indextime' is invalid. The aggregation specifier must be in func_name format.

Tags (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

'_indextime - _time` is not a valid expression. You need to extract _indextime and _time separately and then find the difference.

| tstats latest(_time) AS _time latest(_indextime) AS _indextime where index=* by index | eval delta=_indextime - _time | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

'_indextime - _time` is not a valid expression. You need to extract _indextime and _time separately and then find the difference.

| tstats latest(_time) AS _time latest(_indextime) AS _indextime where index=* by index | eval delta=_indextime - _time | ...
---
If this reply helps you, Karma would be appreciated.

danielbb
Motivator

Useful thing, but does it really give back the max delay per index? or the latest delay per index?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's the latest. Max(_time)==latest(_time). To find the true max would require reading every event in every index and performing stats max(eval(_indextime - _time)) on each. That would be very slow.

This query may help more. It shows the lag time per minute to help you identify when lags are happening.

| tstats latest(_time) AS time latest(_indextime) AS indextime where index=* by index, _time span=1m | eval delta=indextime - time | where delta>0
---
If this reply helps you, Karma would be appreciated.

danielbb
Motivator

That's great @richgalloway

0 Karma
Get Updates on the Splunk Community!

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

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 ...

Splunk Observability Synthetic Monitoring - Resolved Incident on Detector Alerts

We’ve discovered a bug that affected the auto-clear of Synthetic Detectors in the Splunk Synthetic Monitoring ...