Splunk Search

How to assign dates using eval

raghu0463
Explorer

Hi,
Here I want to assign Initial_L1_Decision_Date dates to Queue_to_Initial_L1_Days. There are some dates for Initial_L1_Decision_Date, but the table for Queue_to_Initial_L1_Days does not show any dates, I'm getting all blanks.

index = index_T1 source= Source_E1 sourcetype = SourceType_E1 |eval Queue_to_Initial_L1_Days = strftime(Initial_L1_Decision_Date, "%Y-%M-%D %H:%M:%S") |table Queue_to_Initial_L1_Days

Thanks

0 Karma

DalJeanis
Legend

Be sure to mark code as code.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Is Initial_L1_Decision_Date in epoch form? There's a typo in the strftime format string. Try "%Y-%m-%d %H:%M:%S".

---
If this reply helps you, Karma would be appreciated.

DalJeanis
Legend

@raghu0463 - I moved this comment to answer because it's the answer.

Use "%Y-%m-%d %H:%M:%S"
Month is %m, not %M
Day is %d, not %D

0 Karma

ddrillic
Ultra Champion

Sample data maybe ; - )

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...