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 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...