Splunk Search

How to find out Server Uptime & Downtime

jaibalaraman
Path Finder

Hi All 

I am trying to find out Server Up time & Downtime or offline 

However i am using the below command which i am not getting what i want 

| mstats max(System.System_Up_Time) AS "Uptime" WHERE index="permon_metrics" host=system1* BY host span=1m
| dedup host | rex field=host "\w{6}(?<function_abbr>\w{4})"
| search function_abbr=ADDS
| sort Uptime asc
| eval Uptime = round((now() - _time) / (60 * 60), 1)
| search Uptime="4.0"

jaibalaraman_0-1728947682562.png

I would like to see the output in a single tile like HH:MM:SS



Tags (1)
0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi @jaibalaraman 

You have a field "Uptime" and then using the eval you are calculating the same field. 
Could you pls suggest us with more details, thanks. 

| mstats max(System.System_Up_Time) AS "Uptime" WHERE index="permon_metrics" host=system1* BY host span=1m
| dedup host | rex field=host "\w{6}(?<function_abbr>\w{4})"
| search function_abbr=ADDS
| sort Uptime asc
| eval UptimeNew = round((now() - _time) / (60 * 60), 1) 
| table Uptime UptimeNew function_abbr host

 

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma

jaibalaraman
Path Finder

jaibalaraman_0-1728951978952.png

 

Sorry what information are you looking for

 

0 Karma

inventsekar
SplunkTrust
SplunkTrust

1) >>> I am trying to find out Server Up time & Downtime or offline 
the logs got a field "Uptime", may i know if the unit is seconds? 

2) how to find out the downtime or offline?

3)  this command will give you number of hours before the logline was received

| eval Uptime = round((now() - _time) / (60 * 60), 1)

 pls suggest us how you like to use this value

4)  may i know why you use the 

| search Uptime="4.0"

 

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...