Splunk Search

Why does the query take so long to find time duration

ma_anand1984
Contributor

index=test_index
| stats min(_time) AS earliest max(_time) AS latest
| eval duration=latest-earliest
| table duration latest earliest

When
I run this query for 30 days it takes very long to run.

Ideally shouldn't it be running fast because its max and min time and should use efficient search to get it?

Tags (1)
0 Karma
1 Solution

jonuwz
Influencer

The data that splunk pulls out of the indexes is governed by the initial search (everything before the 1st | )

In this case you're pulling every event for the last 30 days (from disk), then having stats operate on that dataset.

This describes the difference between streaming and non-streaming search commands

View solution in original post

0 Karma

jonuwz
Influencer

The data that splunk pulls out of the indexes is governed by the initial search (everything before the 1st | )

In this case you're pulling every event for the last 30 days (from disk), then having stats operate on that dataset.

This describes the difference between streaming and non-streaming search commands

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