Splunk Dev

Changing time format

zacksoft
Contributor

Currently I'm using a stats command to populate a few fields along with time.
The command is as follows,
stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage

Here I get Time in a strange format , like 1515424081.
Is there any way to change the format to something readable ?

Tags (1)
0 Karma
1 Solution

mayurr98
Super Champion

hey @zacksoft

try this

<your_base_query> |stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage | eval c_time=strftime(Time,"%m/%d/%y %H:%M:%S")

Let me know if it works!

View solution in original post

mayurr98
Super Champion

hey @zacksoft

try this

<your_base_query> |stats values(session_id) as Session values(_time) as Time values(action) as Action_Performed values(success) as Rate by usage | eval c_time=strftime(Time,"%m/%d/%y %H:%M:%S")

Let me know if it works!

zacksoft
Contributor

@mayurr98 Perfecto !!

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 ...