- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kirrusk
Communicator
08-26-2020
07:17 AM
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
08-26-2020
07:23 AM
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")
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
08-26-2020
07:23 AM
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")
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kirrusk
Communicator
08-26-2020
07:40 AM
can u please suggest how to convert the diff values to days
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

richgalloway

SplunkTrust
08-26-2020
09:00 AM
Let eval do the math for you.
| eval days = diff / 86400
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
