Splunk Search

How do I convert this string into a timestamp? the convert and eval functions don't work.

gregbo
Communicator

I have the following string:

20170306155556+0000

Splunk doesn't seem to understand that format. I've tried strptime, strftime, convert(auto)...nothing works. How do i get splunk to recognize that (that string is referring to "March 06, 2017, at 15:55:56 UTC).

Tags (1)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

This works for me (run anywhere sample search)

| gentimes start=-1 | eval date="20170306155556+0000" | table date | eval _time=strptime(date, "%Y%m%d%H%M%S%z")

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

This works for me (run anywhere sample search)

| gentimes start=-1 | eval date="20170306155556+0000" | table date | eval _time=strptime(date, "%Y%m%d%H%M%S%z")

gregbo
Communicator

That worked perfectly! Thanks!

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...