How to I convert the following time to 2023-05-18 08:11:52
2023-05-18T08:11:52.000-07:00
Hi @power12
Here are some examples of how to do it...
| makeresults
| eval mytime="2023-05-18T08:11:52.000-07:00"
,mytime_epoch=strptime(mytime, "%FT%T.%3N") ``` convert to epoch seconds - ignore the timezone unless you want to account for it ```
,mytime_reformated=strftime(mytime_epoch, "%F %T") ``` format time ```
,mytime_nested=strftime(strptime(mytime, "%FT%T.%3N"), "%F %T") ``` can nest the time functions too ```
,mytime_replace=rtrim(replace(mytime, "(T|\..*)", " ")) ``` OR string manipulation would work in this case too ```
Hope it helps