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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...