Splunk Search

Change time format

TheBravoSierra
Path Finder

I have a field called "Completed_On" in time format: 12/23/2020 14:16:51.

I'd like to remove the hours, minutes, and seconds so it just displays 12/23/2020. 

How can I do this? 

Labels (2)
0 Karma
1 Solution

alonsocaio
Contributor

HI @TheBravoSierra 

You can try using the strftime function:

| eval Completed_On_New = strftime(Completed_On, "%m/%d/%Y")

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @TheBravoSierra,

Try below;

| eval Completed_On=mvindex(split(Completed_On," "),0)

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

alonsocaio
Contributor

HI @TheBravoSierra 

You can try using the strftime function:

| eval Completed_On_New = strftime(Completed_On, "%m/%d/%Y")
Get Updates on the Splunk Community!

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 at Splunk .conf24 ...

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

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...