Getting Data In

How to convert "LastBootUpTime" to epoch time (including the timezone offset) in order to get the epoch reported in GMT?

ppeterson
Path Finder

I'm having difficulties converting Microsoft's LastBootUpTime into Epoch taking the timezone offset into account to get an Epoch in GMT value for comparison. Would anyone have any ideas to assist?

LastBootUpTime="20170522110049.412726-240"

Thanks,
Paul

0 Karma

somesoni2
Revered Legend

Give this a try (runanywhere search for testing, just use the last line for conversion expression)

| gentimes start=-1 | eval LastBootUpTime="20170522110049.412726-240" 
| eval _time=strptime(LastBootUpTime,"%Y%m%d%H%M%S.%N%Z")
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...