Splunk Search

Timechart time

darksky21
Path Finder

Hi i have a timechart

| timechart count by serial_number

is there a way to change the use of _time to another date field?

Tags (1)

norbert_hamel
Communicator

yes, you can use any other field which contains a time information:

| eval _time=MyTime

If MyTime is a text string, you can use strptime to convert the string to time. For example, if the MyTime is "03-22-2013 11:55":

| eval MyTimeDate=strptime(MyTime,"%m-%d-%Y %H:%M") | eval _time=MyTime

Ayn
Legend

Sure. timechart is, more or less, an alias for bucket _time | chart <functions> over _time so if you want to use another field, just do

`bucket yourfield | chart <functions> over yourfield`
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...