Splunk Search

What is strptime format for 2017-08-01T11:48:15.000+0000

balamurali_dece
New Member

I want to load a json into splunk. The time stamp of each event is in the format 2017-08-01T11:48:15.000+0000. I used %Y-%m-%dT%H:%M:%S.%3N+%z and similar combinations so that splunk recognises the time stamp but with no success. What is correct strptime format so that splunk understands this.

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The %z format variable includes the '+' so you don't have to specify it separately. Try %Y-%m-%dT%H:%M:%S.%3N%z.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The %z format variable includes the '+' so you don't have to specify it separately. Try %Y-%m-%dT%H:%M:%S.%3N%z.

---
If this reply helps you, Karma would be appreciated.

adonio
Ultra Champion

looks like it works fine:
try it:

  | makeresults count=1 
 | eval t = "2017-08-01T11:48:15.000+0100, 2017-08-01T12:48:15.000+0200, 2017-08-01T13:48:15.000+0300"
 | makemv delim="," t
 | mvexpand t
 | eval time = strptime(t, "%Y-%m-%dT%H:%M:%S.%3N%z")
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...