Splunk Search

Can you help me to extract a date field?

ramprakash
Explorer

Hello Splunkers,

I need to extract only the date with the below logs in format mm/dd/yyyy. Could you please assist? Thanks

Tue Apr 02 00:00:00 EDT 2019

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try this:

... | eval date=strftime( strptime(<datetime field>, "%b %a %d %H:%M:%S %Z %Y"), "%m/%d/%Y") | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma
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 ...