I am trying to determine uptime duration on Windows 7036 events. Below is sample data:
TIME SERVICE STATE
10:00 splunk running
10:03 splunk running
10:04 splunk stopped
10:07 splunk stopped
10:10 splunk stopped
10:15 splunk running
10:16 splunk stopped
10:20 splunk running
I'm trying to compute for a period of time (20 mins here) the total time that a service (Splunk here) is in a running or stopped service state. I will then use those totals to produce an uptime percentage. Any suggestions?
I think you can use the transaction command to accomplish that. First you need to have a field that will identify the values "Splunk running" and "Splunk Stopped", let say this field is called splunk_status. Than you can submit the transaction:
your search | transaction splunk_status | stats sum(duration) AS duration by splunk_status
After this search you will have a table with splunk_status and duration fields. Now you can sum both to find total with the command " | addcoltotals".