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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...