Archive

Drill down from table to another dashboard

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

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

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

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

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!