Splunk Search

how to find the total time taken by a search to finish the run for both adhoc and saved searches

manjuase
Explorer

Hi,
i want to find out the total run time of both ad-hoc and saved searches. I checked in _audit index to find out the total_run_time.. there i can find the total_Run_time for saved searches but i want to find the total run time for the ad-hoc search as well.

please help me to get the total_run_time.

0 Karma

koshyk
Super Champion

The best way to do is to go to your "Monitoring console"
splunk_url/en-US/app/splunk_monitoring_console/search_usage_statistics_instance

There is a "Only Ad Hoc Searches" radio choice. You can put to "No"
Once you do this, there will be a small "search icon" coming up under that panel. You can click on that search icon to get the search query/SPL behind it if you need it.

The core part of search is something like

(search_id!="rsa_*" action=search  index=_audit sourcetype=audittrail) 
| stats min(_time) as _time, values(user) as user, max(total_run_time) as total_run_time, first(search) as search, first(search_type) as search_type, first(apiStartTime) as apiStartTime, first(apiEndTime) as apiEndTime by search_id
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...