Dashboards & Visualizations

How to get time in x chart axis?

jip31
Motivator

hi

I use a timechart which is linked to a "today" token time 

On the x axis, I need only to display events between 7h and 19h

I tried this but the x axis go to 0.00h from the current time

How to do for the x axis begin only a 7h00?

thanks

 

index=toto
| eval local_time=strftime('_time', "%H%M") 
| search local_time >="0700" AND local_time <="1900" 
| timechart span=15min dc(s) as user by type

 

 

Labels (1)
Tags (2)
0 Karma
1 Solution

SanjayReddy
SplunkTrust
SplunkTrust

Hi @jip31 

time is coming as hour minuites because you are converting only %H %M in strftime 
if you want to add as date please add vatiables you needed 

FYI 

SanjayReddy_0-1646212486112.png

| eval local_time=strftime('_time', "%H%M")

View solution in original post

0 Karma

SanjayReddy
SplunkTrust
SplunkTrust

Hi @jip31 

assigne localtime as _time 

index=toto
| eval local_time=strftime('_time', "%H%M")
| eval _time=local_time
| search _time>="0700" AND _time<="1900"
| timechart span=15min dc(s) as user by type

0 Karma

jip31
Motivator

thanks but i have an issue on the x axis which is converted in hour minutes

how to avoid this?

0 Karma

SanjayReddy
SplunkTrust
SplunkTrust

Hi @jip31 

time is coming as hour minuites because you are converting only %H %M in strftime 
if you want to add as date please add vatiables you needed 

FYI 

SanjayReddy_0-1646212486112.png

| eval local_time=strftime('_time', "%H%M")

0 Karma

jip31
Motivator

I convert in hour minutes in order to choose only events in this slot time

so is it possible to do this while having good date format in x axis?

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...