Reputation: 53
Splunk convert Wed Sep 23 08:00:00 PDT 2020 to _time and epoch time in splunk . What is the splunk query to convert java date format to yyyy-MM-dd
Upvotes: 0
Views: 3012
Reputation: 9916
To convert time strings from one format to another you must strptime()
convert to epoch form and then use strftime()
to convert to the desired result format.
... | eval newTS=strftime(strptime("Wed Sep 23 08:00:00 PDT 2020", "%a %b %d %H:%M:%:S %Z %Y"), "%Y-%m-%d")
Upvotes: 0