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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...