Splunk Search

Whaat is the tstats dynamic way to set the value on index to prevent wildcard?

kelz
Explorer

Hi Splunkers,

I was wondering if this is possible on tstats command. Get the dynamic value from savedsearch result or lookup? savedsearch or lookup is updating every hour.

 

| tstats max(_time) as last_updated WHERE index=* BY index, host

 



To avoid wildcard.. I was thinking it will be efficient if that is possible.

Appreciate any response.. Thanks!

Labels (1)
Tags (2)
0 Karma
1 Solution

rymundo_splunk
Splunk Employee
Splunk Employee

Hi, maybe something like

|tstats count where [|makeresults | eval index="_internal"|fields index] by index, host

That subsearch can return a field named index which then gets used for tstats.  Hope this helps.

View solution in original post

0 Karma

rymundo_splunk
Splunk Employee
Splunk Employee

Hi, maybe something like

|tstats count where [|makeresults | eval index="_internal"|fields index] by index, host

That subsearch can return a field named index which then gets used for tstats.  Hope this helps.

0 Karma

kelz
Explorer

Thank you so much @rymundo_splunk it works!

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