Splunk Search

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

gasdrubadiss
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

richgalloway
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, Karma would be appreciated.
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...