Splunk Search

Yesterday data dashboard filtering -

nelesama
Explorer

An extension of this:
https://community.splunk.com/t5/Splunk-Search/Looking-at-yesterdays-data-but-need-to-filter-the-data...

 

I've created a dashboard on the above with an input that adds the timewrap line when the option is selected yes and nothing when the option is selected no.

 

The issue I am having is when no is selected, the graph looks like the following when I select smaller time windows. Below I selected 4 hours but how can I only show the last 4 hours and not the previous window.

Screenshot 2024-10-01 at 13.48.49.png

 

Query is as follows:

index=foo 
[| makeresults
| fields - _time
| addinfo
| eval day=mvrange(0,2)
| mvexpand day
| eval earliest=relative_time(info_min_time,"-".day."d")
| eval latest=relative_time(info_max_time,"-".day."d")
| fields earliest latest]
| timechart span=1m sum(value) as value | eval _time=_time

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Depending on how you have "removed" the timewrap command you could have a token which starts and ends a comment (```)

 

index=foo 
$comment$ [| makeresults
| fields - _time
| addinfo
| eval day=mvrange(0,2)
| mvexpand day
| eval earliest=relative_time(info_min_time,"-".day."d")
| eval latest=relative_time(info_max_time,"-".day."d")
| fields earliest latest] $comment$
| timechart span=1m sum(value) as value | eval _time=_time
$comment$ | timewrap 1d $comment$

 

View solution in original post

0 Karma

nelesama
Explorer

Hi,

The token element works well but when no has been selected from the filter, nothing extra is added to the code. I was wondering how I can stop the graph from being split in two when no is selected

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What happens when you tried my solution?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Depending on how you have "removed" the timewrap command you could have a token which starts and ends a comment (```)

 

index=foo 
$comment$ [| makeresults
| fields - _time
| addinfo
| eval day=mvrange(0,2)
| mvexpand day
| eval earliest=relative_time(info_min_time,"-".day."d")
| eval latest=relative_time(info_max_time,"-".day."d")
| fields earliest latest] $comment$
| timechart span=1m sum(value) as value | eval _time=_time
$comment$ | timewrap 1d $comment$

 

0 Karma

nelesama
Explorer

Ahh I see what you mean.

Never though to use the comment like that and several times.

Thank you

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...