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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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