I'm experimenting with HTML dashboards. One problem - if I add one to the navigation menu, I cannot show a different name - it shows the file name (without .html) up there. For XML dashboards, their label is displayed, but Splunk doesn't seem to know what to extract from HTML (is it even implemented?). I tried label=
attribute, just like collection tag, but it didn't work either.
In fact, I cannot change what is displayed for any dashboard - it's label tag content from XML and file name from HTML. Is there any way to fix it?
One of the reasons an HTML dashboard may show an incorrect title is that the title will revert to the file name if the HTML is not properly formatted. If there are any issues with tags and end tags being mismatched or anything that would throw of an HTML checker it will "fail" this check and cause Splunk not to get the correct title from the header of the page.
Also, if you have custom javascript in your dashbaord you need to wrap it in what I call "fake" CDATA tags (at least in versino 6.5, I haven't tested for others). Basically, for whatever Splunk uses to verify the HTML of a page, javascript needs to be wrapped like this:
there's a space inserted in front of the ! so the site doesn't think I need an actual cdata tag
// < ![CDATA[
... code goes here ...
// ]]>
Despite being commented out, and of no use to a browser, the HTML checker Splunk uses looks for those tags and ignores the things between them. This prevents JS code from tripping the checker with an error and allows Splunk to properly grab a page title.
I hate to bring this back up but we are now on version 7 of Splunk and I still have yet to find a solution other than use the anchor tag in the navigation menu to link back to Splunk.
Hi skisoccer13
This question is almost 3 years old. Please post a new question to get maximum exposure and help on your problem.
Thanks!
One of the reasons an HTML dashboard may show an incorrect title is that the title will revert to the file name if the HTML is not properly formatted. If there are any issues with tags and end tags being mismatched or anything that would throw of an HTML checker it will "fail" this check and cause Splunk not to get the correct title from the header of the page.
Also, if you have custom javascript in your dashbaord you need to wrap it in what I call "fake" CDATA tags (at least in versino 6.5, I haven't tested for others). Basically, for whatever Splunk uses to verify the HTML of a page, javascript needs to be wrapped like this:
there's a space inserted in front of the ! so the site doesn't think I need an actual cdata tag
// < ![CDATA[
... code goes here ...
// ]]>
Despite being commented out, and of no use to a browser, the HTML checker Splunk uses looks for those tags and ignores the things between them. This prevents JS code from tripping the checker with an error and allows Splunk to properly grab a page title.
This answer was helpfull for me.. Because of an inproper html we didn't get the title right. After fixing the html, the title was showing correctly. Thanks!
I downvoted this post because this is not an answer for the question at all.
Why? It's the correct answer.. If your html is properly formated the title will show correctly..
The CDADA tag is not used in pure HTML dashboards which is what the poster was stating he/she was doing. Javascript does not have to be wrapped in anything in a pure HTML dashboard. Splunk does absolutely no checking of any code in a HTML dashboard.
Give it a try, create a blank dashboard and convert to HTML. The title of the tab is set in the element. In a converted dashboard the CDATA tags I referred to are right above the require statement. As you can see they are commented out in the HTML syntax, but if you remove them and save, the title of the tab will revert back to the html file name.
Hope you find it illuminating and happy Splunking!
How so? It explains the (potential) cause and how to correct.
Thanks for the answer. That's what I hate about Splunk - so much arcane knowledge, which is either not documented or is hard to find.
Since the time I asked this question, we completely moved away from HTML dashboards - we found ways to attach our JavaScript to the specific items on the dashboard using ID. And it's very useful to keep the ability to edit panels easily - we need to be more dynamic than that.
What is the HTML checker that Splunk uses?
Hi,
We can clone the view in settings-userinterface-views under your applications
and you can add that view name in navigation.
settings-userinterface-navigations under your application
I have tested this in my server and it is working
-Krishna Rajapantula
No, that's not helpful - the new view is also referred by its internal name. I cannot have a menu item reading "My HTML Dashboard", for example - filenames in Splunk don't allow whitespaces, among other things. If I wanted to have my_html_dashboard
menu item, I would have named my new dashboard that way from the beginning.
I believe Splunk has no way to do it properly for HTML dashboards. I'd suggest something like <view name="my_html_dashboard">My HTML Dashboard</view>
- it's not working right now, but it might be a good model to implement.