To convert time strings into a different format, use a combination of strptime() and strftime().
... | eval newFormat=strftime(strptime(oldformatfield, "%a %b %d %H:%M:%S %Y"), "%Y-%m-%d %H:%M:%S")
To get the difference between two dates, however, you must use the parsed (epoch) form.
... | eval diff = strptime(oldformatfield1, "%a %b %d %H:%M:%S %Y") - strptime(oldformatfield2, "%a %b %d %H:%M:%S %Y")
To convert time strings into a different format, use a combination of strptime() and strftime().
... | eval newFormat=strftime(strptime(oldformatfield, "%a %b %d %H:%M:%S %Y"), "%Y-%m-%d %H:%M:%S")
To get the difference between two dates, however, you must use the parsed (epoch) form.
... | eval diff = strptime(oldformatfield1, "%a %b %d %H:%M:%S %Y") - strptime(oldformatfield2, "%a %b %d %H:%M:%S %Y")
can u please suggest how to convert the diff values to days
Let eval do the math for you.
| eval days = diff / 86400