Splunk Search

Convert log time (epoch) to readable Date and time

raindrop18
Communicator

I have this on my log including epoch time, how I can convert the time next to msg to readable time.

"rank=msg(1489546552.151:69280424)"

Tags (1)
0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust
 ...|rex field=rank "msg\((?<epoch>\d+\.\d+)" 
 | convert ctime(epoch) 
 | table epoch

View solution in original post

woodcock
Esteemed Legend

Like this:

The setup:

| makeresults | eval rank="msg(1489546552.151:69280424)" 

The solution:

| rex field=rank "msg\((?<epoch>\d+\.\d+)"
| fieldformat epoch=strftime(epoch, "%m/%d/%Y %H:%M:%S")
0 Karma

jkat54
SplunkTrust
SplunkTrust
 ...|rex field=rank "msg\((?<epoch>\d+\.\d+)" 
 | convert ctime(epoch) 
 | table epoch

raindrop18
Communicator

thanks ,that works as expected.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...