i am able to derive the service uptime. I think what i have done is correct.
I have taken the concept from nagios service/host uptime. they calculating the uptime from the logs. for example in the log, they are looking for ok/critical/warning etc. Based on the service status, they are calculate the %.
I have applied the same concept, i have forward all logs from sensu to elasticsearch. Using Pie chart, i can count the “check.status” value, here check status can be defined as 0,1,2,3 (0-success, 1-warning, 2-critical, 3-unknown)