Dashboards & Visualizations

Drill down from table to another dashboard

andreafebbo
Communicator

Hi all.
I have a simple dashboard with a table with few columns.
One of these columns represent name of servers.
Id like to click in one cell (or even better in all the row) and being sent to another splunk report which the url is like:

......../app/search/dashboard_name/ form.fieldTime.earliest=%40d&form.fieldTime.latest=now&form.Server_Name=SERVER_NAME

What i need to do is to click on that cell (or row) and to be sent (better id in a new sheet) to that url, but replacing SERVER_NAME with what is written in the cell.

I think is pointless to add code because is just a table.

Thank you all!

1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi andreafebbo,
see in Splunk 6.0 Dashboard examples (https://splunkbase.splunk.com/app/1603/) there are some examples to do what you need.
In simple words:
insert at the end of you table tag

<drilldown>
   <link>
      <![CDATA[nomeform?SERVER_NAME=$row.SERVER_NAME&amp;TimeFrom=$Time.earliest$&amp;TimeTo=$Time.latest$]]>
   </link>
</drilldown>

Insert in your secondary dashboard's searches your token host=$SERVER_NAME$
Insert TimeFrom and TimeTo in earliest and latest tags of each search.

Bye.
Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi andreafebbo,
see in Splunk 6.0 Dashboard examples (https://splunkbase.splunk.com/app/1603/) there are some examples to do what you need.
In simple words:
insert at the end of you table tag

<drilldown>
   <link>
      <![CDATA[nomeform?SERVER_NAME=$row.SERVER_NAME&amp;TimeFrom=$Time.earliest$&amp;TimeTo=$Time.latest$]]>
   </link>
</drilldown>

Insert in your secondary dashboard's searches your token host=$SERVER_NAME$
Insert TimeFrom and TimeTo in earliest and latest tags of each search.

Bye.
Giuseppe

loggar
Explorer

Put page in HTML and then edit...

in your TableElement put "drilldown":"row", if you want to redirect by clicking on a row ..or "drilldown":"cell" if you want to redirect by clicking on cell...
like

var element1 = new TableElement({
                    "id": "element1",
                    "count": 100,
                    "dataOverlayMode": "none",
                    "drilldown": "row",
                    "link.visible": false,
                    "rowNumbers": "false",
                    "wrap": "true",
                    "managerid": "search1",
                    "el": $('#element1')
                }, {tokens: true, tokenNamespace: "submitted"}).render();

Then after your TableElement put code like

element1.on("click", function(e) {
                    if (e.field !== undefined) {
                        e.preventDefault();
                        var url = TokenUtils.replaceTokenNames("{{SPLUNKWEB_URL_PREFIX}}/app/search/dashboard_name/form.fieldTime.earliest=%40d&form.fieldTime.latest=now&form.Server_Name=$click.value$", _.extend(submittedTokenModel.toJSON(), e.data), TokenUtils.getEscaper('url'));
                        utils.redirect(url);

                    }
                });

..put your servername in first column.

0 Karma

andreafebbo
Communicator

If I understood well, for doing so i need an HTML dashboard?
Is there any way to keep the dashboard xml?
(I hope i'm clear)
Thanks

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...