Splunk Search

How to find long-running searches in Splunk, with execution time in mins?

shinde0509
Explorer

How to find long-running searches in Splunk, with execution time in mins.

Labels (2)
Tags (1)
0 Karma

shinde0509
Explorer

Not having access to Monitoring Consoles, SO using SPL want to create dashboard.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you don't have access to the MC then you probably don't have access to the _internal index, which is where run times are reported.

---
If this reply helps you, Karma would be appreciated.
0 Karma

shinde0509
Explorer

Having access to _internal and _audit Indexes.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should get you started.

(index=_audit host=* action=search sourcetype=audittrail search_id!="rsa_*") 
| eval user = if(user="n/a", null(), user) 
| eval search_id=replace(search_id, "'(.*)'", "\1") 
| eval search=if(isnull(savedsearch_name) OR savedsearch_name=="", search, savedsearch_name) 
| stats min(_time) as _time, values(user) as user, max(total_run_time) as total_run_time, first(search) as search, first(apiStartTime) as apiStartTime, first(apiEndTime) as apiEndTime by search_id
---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

The Monitoring Console has a dashboard for that.  See Settings->Monitoring Console->Search->Search Usage Statistics: Instance then scroll down.

---
If this reply helps you, Karma would be appreciated.
0 Karma

jo
New Member

very good!!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...