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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...