Hi all,
I am running the below query, I get responses from some of my Splunk servers but not all ?
| rest /services/server/info | eval LastStartupTime=strftime(startup_time, "%Y/%m/%d %H:%M:%S")
| eval timenow=now()
| eval daysup = round((timenow - startup_time) / 86400,0)
| eval Uptime = tostring(daysup) + " Days"
| table splunk_server LastStartupTime Uptime
Is there anything I am missing on the servers that are not reporting back ?
Cheers
Paul
Please, check this splunk answers, maybe it fits your purposes:
https://answers.splunk.com/answers/105128/how-to-determine-how-long-splunk-has-been-up.html
The rest
command is only sent to indexers so only those servers will respond. You will not get any data about search heads and other non-indexer instances.
cheers for the info richgalloway
I found this to work from our DMC for all instances. I can see retrieve info for all instances that are search peers of the DMC. Without "splunk_server=*" then I only see the indexers.
| rest splunk_server=* /services/server/info
| table host, startup_time
| eval uptime=tostring(now() - startup_time, "duration")
hope this helps
Thank you, Can confirm that this works as expected. I was also looking for a way to see all of the splunk instances:
Run from the DMC:
| rest splunk_server=* /services/server/info | eval LastStartupTime=strftime(startup_time, "%Y/%m/%d %H:%M:%S")
| eval timenow=now()
| eval daysup = round((timenow - startup_time) / 86400,0)
| eval Uptime = tostring(daysup) + " Days"
| table splunk_server LastStartupTime Uptime