Have any analysis that tells me the minutes since a device was rebooted.
’ ((now - boot time of operating system) / minute) as string & " minutes" ’
What I’d really like to see is H:M format so if its 80 minutes, the result would be ’ 1 hr 20 min’. Once the minutes start getting big, its hard to read. Any suggestions would be appreciated.
@jgstew’s answer looks like the easiest way to handle this case, but to handle more generic time intervals you’d use the “/” (integer division) and the “mod” (modulus, ie integer remainder) operators. A few examples to help illustrate:
q: 133 / 60
A: 2
T: 0.018 ms
I: singular integer
q: 133 mod 60
A: 13
T: 0.017 ms
I: singular integer
Q: now - boot time of operating system
A: 6 days, 02:52:40.125
T: 0.039 ms
I: singular time interval
q: (now - boot time of operating system) / day
A: 6
T: 0.034 ms
I: singular integer
q: (now - boot time of operating system) mod day
A: 02:52:40.125
T: 0.042 ms
I: singular time interval
q: ((now - boot time of operating system) mod day) / hour
A: 2
T: 0.045 ms
I: singular integer
q: ((now - boot time of operating system) mod day) mod hour
A: 00:52:40.125
T: 0.037 ms
I: singular time interval
q: ((now - boot time of operating system) mod day) mod hour / minute
A: 52
T: 0.039 ms
I: singular integer
q: ((now - boot time of operating system) / day )as string & " days, " & (((now - boot time of operating system) mod day) / hour) as string & " hours, " & (((now - boot time of operating system) mod day) mod hour / minute) as string & " minutes"
A: 6 days, 2 hours, 52 minutes
T: 0.065 ms
I: singular string
Another thing I would recommend is having a property with RAW time data in a format BigFix can understand natively so that it can be transformed into multiple different preferred formats after the fact in WebReports.
You can also have a relevance property in an analysis that gives you a more human readable form, but don’t make a human readable property only. You will end up doing complicated things to get it into the more human readable format, then you’ll end up doing complicated things on the Session Relevance / WebReports side to re-parse that data back into a native value so then it can be parsed back out into a different form again.
Also, on the WebReports side, it is more valuable to have boot time of operating system, rather than the uptime because you can calculate the expected uptime in WebReports even for computers that may be offline by taking the difference at that moment, rather than relying on the client to update the value.