Splunk Search

Convert time

chadman
Path Finder

I'm trying to rename _time to Time and it's changing the format. I used ctime to fix it, but I only want to display it in the HH:MM format. I can I covert my ctime to only show HH:MM?

        | eval Time = _time
        | table Time "Idle Time" | convert ctime(Time)
0 Karma
1 Solution

sundareshr
Legend

Try this

| eval Time=strftime(_time, "%H:%M") | table Time, "Idle Time"

View solution in original post

sowings
Splunk Employee
Splunk Employee

_time is always in Unix epoch time. If you leave that field name alone, it will "magically" convert it to human readable for you. Using the convert function or the strftime eval function provides you with the option to "name your format".

sundareshr
Legend

Try this

| eval Time=strftime(_time, "%H:%M") | table Time, "Idle Time"

chadman
Path Finder

Thanks, that did it!

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