Getting Data In

Splunk server uptime - missing Splunk server details

pbrinkman
Path Finder

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

Tags (2)
0 Karma

ivanreis
Builder

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

0 Karma

richgalloway
SplunkTrust
SplunkTrust

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.

---
If this reply helps you, Karma would be appreciated.
0 Karma

pbrinkman
Path Finder

cheers for the info richgalloway

0 Karma

coreyCLI
Path Finder

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

amatodersp
Engager

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

 

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Shortly, you could run rest towards all defined search peers. This is the reason why it works on MC. Basically you could add additional peers (like HFs, currently as indexers) and then get that information from them.
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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