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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...