Getting Data In

time format for 2017-02-03T05:54:20.022Z

AzmathShaik
Path Finder

Hello My time stamp looks like 2017-02-03T05:54:20.022Z

am trying %Y-%m-%dT%H:%M:%S.3%N%Z but no luck

can any one help me

0 Karma
1 Solution

woodcock
Esteemed Legend

Your have 3%N but you need %3N instead:

TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N%Z 

View solution in original post

woodcock
Esteemed Legend

Your have 3%N but you need %3N instead:

TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N%Z 

mpreddy
Communicator

Hi Azmath,

What exactly are you looking with this time format?

Below is to query convert your time to epoch:

|stats c|eval urtime="2017-02-03T05:54:20.022Z"|eval desiredtimeepoch=strptime(urtime,"%Y-%m-%dT%H:%M:%S.%3N%Z")|table desiredtimeepoch

If you are looking to format the time you can use this query and do modifications as per your requirement:

|stats c|eval urtime="2017-02-03T05:54:20.022Z"|eval desiredtimeepoch=strptime(urtime,"%Y-%m-%dT%H:%M:%S.%3N%Z")|eval formattedtime=strftime(desiredtimeepoch,"%Y%m%d")|table desiredtimeepoch,formattedtime

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 ...