Hi ,
In splunk query I need to convert date format as below .
Current format - 07/09/23
Required Format : 2023-09-07
Use the strptime function to convert the current format into epoch form then use strftime to convert that into the required format. The two functions can be used in a single eval.
| eval timefield=strftime(strptime(timefield, "%d/%m/%y"), "%Y-%m-%d")
Hi @dhiraj ,
you have to use the eval command with the strftime and strptime options, like this:
| eval new_date=strftime(strptime(date,"%d/0m/%y"),"%Y-%m-%d")
Ciao.
Giuseppe