- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jip31
Motivator
05-14-2019
04:59 AM
hi
I would like to know if it's possible to add an hyperlink between title tags
<panel>
<title>Crashes volume (%)</title>
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
05-14-2019
05:16 AM
@jip31
Can you please try this?
<dashboard script="myPanel.js">
<label>Test Label</label>
<row>
<panel id="myPanel">
<title>Test Title</title>
<table>
<search>
<query>|stats count</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
</dashboard>
myPanel.js
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function (
mvc) {
var title = $("#myPanel .panel-title").text();
var link = "https://www.google.com";
$("#myPanel .panel-title").html("<a target='_blank' href='"+link+"'>"+title+"</a>");
});
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
05-14-2019
05:38 AM
Hi
Give a try
<dashboard script="title.js">
<label>Title</label>
<init>
<set token="url">http://google.com</set>
<set token="label">Google</set>
</init>
<row>
<panel id="test">
<title>.</title>
<table>
<search>
<query>index="_internal" |stats count</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<done>
<set token="count">$result.count$</set>
</done>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
js:
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!",
], function(mvc) {
$(document).ready(function () {
var defaultTokenModel = mvc.Components.get("default");
var url = defaultTokenModel.get("url");
var label = defaultTokenModel.get("label");
$('#test h2[class="panel-title"]').html('<a target="_blank" href="' + url +'">'+ label+'</a>');
});
});
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jip31
Motivator
05-14-2019
05:46 AM
thanks but its not possible directly in CSS??
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
05-14-2019
05:16 AM
@jip31
Can you please try this?
<dashboard script="myPanel.js">
<label>Test Label</label>
<row>
<panel id="myPanel">
<title>Test Title</title>
<table>
<search>
<query>|stats count</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
</dashboard>
myPanel.js
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function (
mvc) {
var title = $("#myPanel .panel-title").text();
var link = "https://www.google.com";
$("#myPanel .panel-title").html("<a target='_blank' href='"+link+"'>"+title+"</a>");
});
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jip31
Motivator
05-14-2019
05:46 AM
thanks but its not possible directly in CSS??
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
05-14-2019
06:58 AM
Not sure. Bcoz, we are adding a link ( an anchor tag ) between title which is nearly not possible using CSS. We have to use some javascript.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jip31
Motivator
05-15-2019
12:02 AM
OK never mind.......
