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!

Announcing Scheduled Export GA for Dashboard Studio

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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...