Splunk Search

Can we convert to tstats?

danielbb
Motivator

Hello,

Is there a way to convert this query to run with tstats? It is _slow_ when running it for two weeks of data...

index=index_name host=IP_name
| eval lag_sec = (_indextime - _time)
| eval lag_min = lag_sec/60
| timechart span=1h avg(lag_min)

 

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @danielbb,

if you have so many events that your search is very slow, you could think to schedule your search every night, saving results in a summary index and then run your search on the summary index, something like this:

Scheduled search:

index=index_name host=IP_name earliest=-d@d latest=@d
| eval lag_sec=(_indextime-_time)
| eval lag_min=lag_sec/60
| timechart span=1h avg(lag_min) AS avg_lg_min
| collect index=my_summary

your new search:

index=my_summary
| table orig_time avg_lg_min

At the same time I'd analyze the performaces  of your storage. has it at least 800 IOPS?

Ciao.

Giuseppe

burwell
SplunkTrust
SplunkTrust
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...