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 (2)
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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...