Getting Data In

Time formatting from a single field

muralianup
Communicator

I have a field where time format in: 20020523135537Z which is 05/23/2002 13:53:37 GMT . How can I convert to human readable form in the results ?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Here's one way.

... | eval timestr = strftime(strptime(field, "%Y%m%d%H%M%S%Z"), "%m/%d/%Y %H:%M:%S %Z") | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Here's one way.

... | eval timestr = strftime(strptime(field, "%Y%m%d%H%M%S%Z"), "%m/%d/%Y %H:%M:%S %Z") | ...
---
If this reply helps you, Karma would be appreciated.

muralianup
Communicator

Thank you. Works perfect.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...