Dashboards & Visualizations

How do you link reports or a search query to a bar chart?

gpayal18
Explorer

I have a bar chart that shows test case status like 60% pass, 40% fail. (that bar chart is generated dynamically based on the values selected in the dropdowns).

My requirement is that when I click on this graph, it should redirect to either reports or a search query, which would show me the testcase details (like testcase ID, testcase name) that are passed or failed.

That search query should be dynamically built based on the values selected in the dropdowns.

Is there any way we can achieve this?

0 Karma

gpayal18
Explorer

Thanks for the response. So, It can only be achieved using tokens. We can't use the temporary variables used while creating the bar chart?
For eg: this is my search query to create Bar chart: $source$ "$Category_token$"|convert auto("$BuildTok1$") as Actualtime |
convert auto(Requirement) as ExpectedTime | eval TestStatus=case(Actualtime==0, "NotExecuted", Actualtime <= ExpectedTime ,"Pass", Actualtime > ExpectedTime, "Fail") |stats count by TestStatus

this search gives me output of 2 columns (teststatus and count) with values below it. So,
1. is it possible to use teststatus in drilldowns?

Or if not teststatus, if I have to use tokens like "$Category_token$", what value would I assign in drilldowns. Becuase their value is not part of the search output.

0 Karma

lakshman239
SplunkTrust
SplunkTrust
Yes, using $row.count$ and $row.TestStatus$ you can invoke the next search (drill-down search)
0 Karma

lakshman239
SplunkTrust
SplunkTrust

You need to implement a drill-down behaviour using token [ captures the field clicked from bar chart] and then invokes another report/search using that token.

Pls see examples in https://docs.splunk.com/Documentation/Splunk/7.2.4/Viz/DrilldownIntro

There are also examples in dashboard app - https://splunkbase.splunk.com/app/1603/

0 Karma
Get Updates on the Splunk Community!

Observability Unveiled: Navigating OpenTelemetry's Framework and Deployment Options

Observability Unveiled: Navigating OpenTelemetry's Framework and Deployment Options A recent Tech Talk, ...

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...