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!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...