Hi Guys,
I need to measure dashboard load time and the size of all searches in a dashboard.
Thanks in advance.
Best,
SB
Run this search after loading your Dashboard
`dmc_audit_get_searches(YourServer)` | 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 | where isnotnull(search) AND search_type="ad hoc" | search user="*" | fields search, total_run_time, _time, apiStartTime, apiEndTime, search_type, user | eval earliest = case( like(apiStartTime, "%ZERO_TIME%") AND like(apiEndTime, "%ZERO_TIME%"), "all time", like(apiStartTime, "%ZERO_TIME%"), "-", 1 == 1, apiStartTime ) | eval latest = case( like(apiStartTime, "%ZERO_TIME%") AND like(apiEndTime, "%ZERO_TIME%"), "all time", like(apiEndTime, "%ZERO_TIME%"), "-", 1 == 1, apiEndTime ) | eval search = if(isnotnull(search), search, "N/A") | `dmc_time_format(_time)` | sort - total_run_time | eval total_run_time = `dmc_convert_runtime(total_run_time)` | fields search, total_run_time, _time, earliest, latest, search_type, user | rename search as Search, total_run_time as "Search Runtime", _time as "Search Start", earliest as "Earliest Time", latest as "Latest Time", search_type as Type, user as "User"
Which Version of Splunk do you run currently? I took the macro out of the Monitoring Console which came with 6.3 or 6.4 I think.
You can find the macros in: Settings->Advanced search->search macros.
Select "Monitoring Console (splunk_monitoring_console)" as App context.
I have 6.4.3.
Run this search after loading your Dashboard
`dmc_audit_get_searches(YourServer)` | 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 | where isnotnull(search) AND search_type="ad hoc" | search user="*" | fields search, total_run_time, _time, apiStartTime, apiEndTime, search_type, user | eval earliest = case( like(apiStartTime, "%ZERO_TIME%") AND like(apiEndTime, "%ZERO_TIME%"), "all time", like(apiStartTime, "%ZERO_TIME%"), "-", 1 == 1, apiStartTime ) | eval latest = case( like(apiStartTime, "%ZERO_TIME%") AND like(apiEndTime, "%ZERO_TIME%"), "all time", like(apiEndTime, "%ZERO_TIME%"), "-", 1 == 1, apiEndTime ) | eval search = if(isnotnull(search), search, "N/A") | `dmc_time_format(_time)` | sort - total_run_time | eval total_run_time = `dmc_convert_runtime(total_run_time)` | fields search, total_run_time, _time, earliest, latest, search_type, user | rename search as Search, total_run_time as "Search Runtime", _time as "Search Start", earliest as "Earliest Time", latest as "Latest Time", search_type as Type, user as "User"
hi @mdorobek ,
i have same doubt. i tried your query but it gives me error at each 'dmc'. as you further said, check on macros but there also i don't find out anything. as i am to new to splunk i am interesting to learn. thanks in advance
Hello @Learner,
at first you need to setup the monitoring console:
https://docs.splunk.com/Documentation/Splunk/8.0.5/DMC/DMCoverview
If you have a distributed environment heres a guide:
https://docs.splunk.com/Documentation/Splunk/8.0.5/DMC/Configureindistributedmode
The monitoring console is a Splunk Enterprise monitoring tool. It lets you view detailed topology and performance information about your Splunk Enterprise deployment.
The search is taken from the monitoring console. You can find the search performance dashboards at "Search->Activity".
The macro is defined in the context of the monitoring console.
I hope this helps you.
@mdorobek
Thanks, works under 7.2.8 like a charm.
Where is this macro defined? My splunk installation can not find it.