Splunk Search

How to edit my search to convert a string to date format?

New Member

hello!

i have this date: 20150225123000998
I want this format date :

25/02/2015 12:30:00  998 (not important)

my search doesn't work:

    index="marketing1" |eval tempo=strftime(TimestampConsenso1, "%Y/%m/%d %H:%M:%n") | table tempo, TimestampConsenso1

this is my result:

9999/12/31 23:59:

help me?
thx

Tags (4)
0 Karma

SplunkTrust
SplunkTrust

Your format string doesn't match your example data. Try this.

index="marketing1" |eval tempo=strftime(strptime(TimestampConsenso1, "%Y%m%d%H%M%S%3S"), "%d/%m/%Y $H:%M:%S  %3N") | table tempo, TimestampConsenso1
---
If this reply helps you, an upvote would be appreciated.