Getting Data In

How can I convert time 2016-09-12T10:16:51.000+00:00 with timezone specified in simple date and time (2016-09-12 10:16:51)format

isha_rastogi
Path Finder

I've been trying to convert "2016-09-12T10:16:51.000+00:00" into simple format i.e:
2016-09-12 10:16:51.
Tried using strptime and strftime
mysearch|eval _time=strptime(_time,"%Y-%m-%d%Z%T%c")| eval _time=strftime(_time,"%Y-%m-%d %H:%M") | timechart count
Any help will be appreciated.

0 Karma
1 Solution

sundareshr
Legend

Try this runanywhere sample.

| makeresults | eval x="2016-09-12T10:16:51.000+05:00" | eval y=strptime(x, "%Y-%m-%dT%H:%M:%S.%3N%z") | eval z=strftime(y, "%Y-%m-%d %H:%M:%S") | table x y z

View solution in original post

0 Karma

sundareshr
Legend

Try this runanywhere sample.

| makeresults | eval x="2016-09-12T10:16:51.000+05:00" | eval y=strptime(x, "%Y-%m-%dT%H:%M:%S.%3N%z") | eval z=strftime(y, "%Y-%m-%d %H:%M:%S") | table x y z
0 Karma

isha_rastogi
Path Finder

It Worked. Thanks 🙂

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