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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...