Hi,
I have a simple table that has some values. All these have a corresponding dashboard with the same name.
I want to navigate to the dashboard for the value clicked.
Here is what I did and it did not work. (Any token value post the ? for passing values does work, but here my requirement is to replace the token for the value clicked before the ?)... Additionally, full link with IP address also works, but since it is a SHC, I don't want to hard code the URL.
<drilldown>
<link>
</app/search/$click.value$]]>
</link>
</drilldown>
Please help!
Thanks,
Ishaan
Hi Dawson014,
I have similar problem to resolve. Did you get the solution for this?
I am getting the same error "Invalid view name requested: "$row.fieldname$". View names may only contain alphanumeric characters." when using drilldown.
Regards,
Rajnish Kumar
Hi Rajnish,
Yes, we did what swbodie suggested and resolved the issue, without using the drilldown feature. We used the script provided below by swbodie with some modifications as per our requirement.
Thanks for your response Dawson014. I will try the same.
It looks like you attempted to use CDATA tags but didn't quite get the syntax right. Try this:
<drilldown>
<link>
<![CDATA[/app/search/$click.value$]]>
</link>
</drilldown>
I'm sorry I misinterpreted your requirement, I did not realize the click value was the name of the dashboard you were trying to link too.
You may be able to accomplish this through javascript with something like this. Not 100% sure on this though:
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomLinkRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
return cell.field === 'column_name';
},
render: function($td, cell) {
var link = cell.value;
var a = $('<a>').attr("href", "/app/search/"+cell.value).attr("target", "_blank").text(cell.value);
$td.addClass('table-link').empty().append(a);
a.click(function(e) {
e.preventDefault();
window.open($(e.currentTarget).attr('href'));
});
}
});
// Get the table view by id
mvc.Components.get('table_id').getVisualization(function(tableView){
// Register custom cell renderer
tableView.table.addCellRenderer(new CustomLinkRenderer());
// Force the table to re-render
tableView.table.render();
});
});
Great! Thanks, though we were trying to use javascript as a last resort. We'll try to implement it.
That's a typo, We used or [CDATA[/app/search/$click.value$]]
or [CDATA[/app/search/$row.fieldname$]]
only. but we we get a message saying:
Invalid view name requested: "$row.fieldname$". View names may only contain alphanumeric characters.
You need to tell it which dashboard (or view name) to go to in this case. As an example if I had a dashboard called my_example_dash that took an input named examplein it would look something like this:
<drilldown>
<link>
<![CDATA[/app/search/my_example_dash?form.examplein=$click.value$]]>
</link>
</drilldown>
This documentation page may help clarify a bit more:
http://docs.splunk.com/Documentation/Splunk/6.2.0/Viz/Dynamicdrilldownindashboardsandforms