Splunk Search

Adding column to timechart table.

sflunk
Engager

I wanted to add my converted Time to a timechart, but don't know how.

|convert ctime(_time) AS Time
|eval Time=strftime(_time, "%m/%d/%Y %H:%M:%S")
|timechart distinct_count(Stuff)

This will give me a table with the default _time value and I wanted to add Time to the timechart and remove the default _time column - is there any way to do this?

Thank you in advance.

Tags (2)
0 Karma

BobM
Builder

Yes. You need to move the eval to after the timechart.

|timechart distinct_count(Stuff)
|eval Time=strftime(_time, "%m/%d/%Y %H:%M:%S")

but this will leave you with both _time and Time and in my case Time was at the wrong end of the table so I added the following.

| fields - _time | table Time *

sflunk
Engager

Worked beautifully. Thank you!!!

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