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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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