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
Revered Legend

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
Revered Legend

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!

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