HOW TO PASS THE VALUE OF TIME RANGE PICKER FROM ONE DASHBOARD TO ANOTHER DASHBOARD USING DRILLDOWN

HOW TO PASS THE VALUE OF TIME RANGE PICKER FROM ONE DASHBOARD TO ANOTHER DASHBOARD USING DRILLDOWN

Hi Guys!!!
Today we have come up with a new interesting new trick in Splunk Dashboard. We are going to show you how we can pass the “Time Range Picker” value from one dashboard to another dashboard using drilldown.
So, let’s start.
Here, we are going to use two dashboards, 1) “First Dashboard”, 2) “Second Dashboard

Step: 1
We have used the below query and created  Dashboard named “First Dashboard”,

index=_internal sourcetype=splunkd_ui_access
| stats count

Image: 1

Step: 2
Click on the “Edit” option.

Image: 2

Step: 3
Click on the “Source” option.

Image: 3

Step: 4
Here, we will edit the “Source” code to add a “time” input (“Time Range Picker”) to this dashboard.


Image: 4


Image: 5


Image: 6

Explanation:
These tags within the “red-bordered” area in the image we have added to create a “time” input (“Time Range Picker”) and the token we have set for this time input is “First_time”.
In the green border (Image: 6) in the “earliest” tag and “latest” tag we have added the tokens “$First_time.earliest$” and “$First_time.latest$”, so the panel in the dashboard will be dependent on the time selected in the “time” input.

You can also know about :  How To See The UF/HF Server Information and OS Details In Splunk

Step: 5
Now, click on the “Save” option to save the changes.


Image: 7

Step: 6


Image: 8

Now, as you can see in Image: 8 the panel of the dashboard is showing the result of “Last 24 hours” [As, in the “Time Range Picker” input “Last 24 hours” selected]

Step: 7
We have used the below query and created a Dashboard named “Second Dashboard”,

index=_internal sourcetype=splunkd_ui_access
| stats count

Image: 9

Step: 8
Click on the “Edit” option.


Image: 10

Step: 9
Click on the “Source” option.


Image: 11

Step: 10
Here, we will edit the “Source” code to add a “time” input (“Time Range Picker”) to this dashboard.


Image: 12


Image: 13


Image: 14

Explanation:
These tags within “red-bordered” area in image we have added to create a “time” input (“Time Range Picker”) and the token we have set for this time input is “Second_time”.
In the green border (Image: 14) in “earliest” tag and “latest” tag we have added the tokens “$Second_time.earliest$” and “$Second_time.latest$”, so the panel in the dashboard will be dependent on the time selected in the “time” input.

Step: 11
Now, click on the “Save” option to save the changes.

You can also know about :  Highlighting the row of two tables with respect to the condition of a single column respectively.


Image: 15

Step: 12  


Image: 16

Now, as you can see on the Image: 16 the panel of the dashboard is showing the result of “Last 4 hours” [As, in the time input (“Time Range Picker”) “Last 4 hours” selected].
Now, we want to pass the “Time Range Picker” value selected in the “First Dashboard” to the “Second dashboard.”
Please, see the below steps.

Step: 13
Now, go to the “First Dashboard” and click on the “Edit” option.

Image: 17

Step: 14
Now, click on the “Source” option.

Image: 18

Step: 15
Now, here we will edit the “Source” to achieve the requirement


Image: 19


Image: 20


Image: 21

Explanation:
<option name=”drilldown”>all</option>” to enable the drilldown in this panel of the “First Dashboards”.

<drilldown>
<link target=”_blank”>/app/search/second_dashboard?form.Second_time.earliest=$form.First_time.earliest$&amp;form.Second_time.latest=$form.First_time.latest$</link>
</drilldown>

“drilldown” tag is used to write the drilldown options, here we have used “link”.

Inside the link tag,
target=”_blank”>/app/search/second_dashboard?
represents the location of the “Second Dashboard” and to link “First Dashboard” to the “Second Dashboard”.
Then in the “link” tag we have the following part,

form.Second_time.earliest=$form.First_time.earliest$&amp;form.Second_time.latest=$form.First_time.latest$
form.Second_time.earliest=$form.First_time.earliest$ -> Passing the earliest time token $form.First_time.earliest$ from the “First Dashboard” in the token form.Second_time.earliest of “Second Dashboard”
form.Second_time.latest=$form.First_time.latest$ -> Passing the latest time token $form.First_time.latest$ from the “First Dashboard” in the token form.Second_time.latest of “Second Dashboard”

You can also know about :  Drilldown on linechart based on "time"

Step: 16


Image: 22

Step: 17


Image: 23


Image: 24

Explanation:
Now, if you see the Image: 23, you can see the “Time Range Picker” selected in the “First Dashboard” is “Last 7 days”.
Now, when we are clicking on the value of the panel in the “First Dashboard”, we are getting the “Second Dashboard” with the same “Time Range Picker” value i.e. “Last 7 days”.

NOTE: The values in the panel of the two dashboards vary because of the continuous data flow. You can set a custom date or time range it will show you the exact same values in both of the dashboards.

Happy Splunking!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.