Splunk Search

Issue trying to use ctime

msarro
Builder

Hey everyone, I am trying to convert two different date fields into unix time to do some mathematical operations. One of my timestamps doesn't want to convert for some reason. Here it is:
20110527162327.013

The time format is YYYYMMDDHHmmss.sss.

I pass it into convert like so:

convert timeformat="%Y%m%d%H%M%S.%q" mktime(AS_Start_Time) 

But it still outputs the exact same input time. Anyone have any ideas?

Tags (1)
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

I suppose it's a bug, but convert...mktime() is probably deprecated at this point in favor of eval...strptime():

eval AS_Start_Time=strptime(AS_Start_Time,"%Y%m%d%H%M%S.%q")

msarro
Builder

The documentation for version 4.2.1 does not show convert as deprecated. Just curious if you're going by best practices or is the function in fact deprecated and the documentation doesn't reflect that?

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...