Dashboards & Visualizations

How can I create a dynamic HTML list of links to related dashboards

mikeydee
Explorer

I am working in a simple dashboard environment and want to include links to related dashboards so make a more coherent experience for my user community. I have done this statically and it is very useful but a pain to maintain; so I would like to make it dynamic.

For example, say I have an Online Shop dashboard giving me an over view of some key metrics, I would like to visibly mention the related dashboards in a list of links at the top of the page.

For Example:

Bashboard Title: My Shop Overview Dashboard
HTML Panel: Toy Sales | Clothing Report | Security Issues   (dynamic links)

Other Overview Panels follow... 

I want the links to be dynamic so that as new dashboard get added then the links will be updated automatically based on some naming convention / filter logic.

I know how to look up the list of available dashboards from other postings on here.

0 Karma

mikeydee
Explorer

Additionally...
In our environment, users can create dashboards whenever they like.... and they do like. The result is that for any given user group there can 100 dashboards. Too many to remember what they all do. Then when looking for that useful dashboard, they can't find it. So they might just create a duplicate.

What I am trying to do is add a "grouping" feature to link related dashboards automatically based on name. Most of our dashboards follow a naming convnetion for example: Sales Overview would be a top level one and Sales Investigator might be a drill down. This feature would recognise this and create links at the top of the pages to show users related dashboards.

I see this as a feature that Splunk itself should offer. It could recognise a grouping and create a parent child relationship, and also help with refactoring of visualisation within the group. Just my two pence.

0 Karma

arjunpkishore5
Motivator

The HTML Panel is limited when it comes to dynamic content. You can update the contents of the html tags dynamically using variables, however, any html tags within the variable will be treated as a string and not an html tag.

As a workaround, have you considered implementing the functionality of the html panel using a custom nav menu and home dashboard. Nav menu can have dynamic lists as explained here - https://dev.splunk.com/enterprise/docs/developapps/addnavsplunkapp/#Dynamic-lists This works exactly like the requirement you mentioned -

I want the links to be dynamic so that
as new dashboard get added then the
links will be updated automatically
based on some naming convention /
filter logic.

You can set the dashboard as landing view for the app as explained here - https://dev.splunk.com/enterprise/docs/developapps/addnavsplunkapp/#Default-search-target-and-home-p...

Hope this helps.

0 Karma

mikeydee
Explorer

Hi arjunpkishore5,
That is nearly it... it provides dynamic content but the match criteria needs to be dynamic, based on a search.

See my update to the original question above for clarification...

0 Karma

to4kawa
Ultra Champion

link sample:

<dashboard>
  <label>link sample</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval url=split("https://www.yahoo.com/#https://www.bbc.com/#https://www.google.com/","#")
| stats count by url
| eval hash=sha256(url)
| table url,hash</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <fields>url</fields>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">row</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      <drilldown>
          <link target="_blank">
https://www.virustotal.com/gui/url/$row.hash$/detection
          </link>
        </drilldown>
      </table>
    </panel>
  </row>
</dashboard>

click url.

Dashboard sample:(link token)

<form>
  <label>html link sample</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
 | eval _raw="http://freeloaderstokyo.com/fill-form.html" 
 `comment("this url is malicious, Do NOT access!")`
 | eval hash=sha256(_raw) 
 `comment("put the url to _raw")`
 | eval link="https://www.virustotal.com/gui/url/".$$hash$$."/detection"
 | eval url=_raw
 | table _time url hash link</query>
          <done>
            <set token="link">$result.link$</set>
          </done>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <html>
        <h2>check token $link$</h2>
    <a href="$link$" target="_blank">URL</a>
      </html>
    </panel>
  </row>
</form>

For multiple cases, it is easier to drill down.

| rest /servicesNS/-/-/data/ui/views
| table "eai:acl.app" id title updated

Can this result be used?

0 Karma

mikeydee
Explorer

Hi tokawa, correct, that is how to get the list of all the available dashboards... and then I can filter the results / group the results just fine.

The issue that I would like to address is populating HTML content from a search result. But there is no visulisation for HTML the nearest would be a 1 row table, which would probably work but would look like a navigation bar so I have discounted that.

0 Karma

to4kawa
Ultra Champion

hi @mikeydee
I create sample dashboard. how about this?
Is it different?

0 Karma

mikeydee
Explorer

Did you forget picture, link?

0 Karma

to4kawa
Ultra Champion

please copy and paste the simpleXML of my answer.
and try.

0 Karma

mikeydee
Explorer

I Gave your suggestion a go thanks.

It looks like this...

https://flic.kr/p/2ioYTR7
alt text

after I removed the links to virus sites 🙂

I guess it kind of works in the sense that it sets one "link" but I would need to define tokens link1, link2 etc so it is dynamic but limited within say max_links. Would be easier than entering the world of advanced XML dashboaards although that is what I actually wnat to get in to..

What I want to achieve would look like this...
alt text
https://flic.kr/p/2ioZZqn

I guess the behaviour that I would like is a bit like the "show / Hide Filters " that you get on a dashboard.

I tried to add images to my response but this forum does not seem to display them.

0 Karma

to4kawa
Ultra Champion

hi, @mikeydee
You can create a table and access the link destination by drilling down as shown in the example.

That's about it, as there are no log examples.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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 ...