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!

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