Dashboards & Visualizations

SVG Custom visualization - drilldown or setting a token

tomaszwrona
Explorer

Hi all,

 

i have used the SVG Custom Visualisation to create a nice picture.

Now i would like to have a drilldown or at least a possibility to set a token, when a part of the picture is clicked on. Is there a way to achieve this? Any hint would be great.

 

Best regards

Tomasz

Labels (2)
0 Karma

tomaszwrona
Explorer

Hi all,

i did manage to answer my own question.

In order to use tokens in SVG Visualization following steps should be taken:

  1. Extend Simple XML Dashboard with Javascript
  2. Put an id on Splunk's default element, for example panel:
    <panel id="svgViz">
  3. Put an id on any SVG element you want to click on, for example g:
    <g id="myId" filter="url(#Shadow)">
  4. In Javascript get the panel:
    var my_panel = $("#svgViz");
  5. And then create onClick function to set myNewToken:
    my_panel.on("click", "#myId", function(e) {
      var default_tokens = mvc.Components.get("submitted");
      default_tokens.set("myNewToken", "value");
    });

 

Best regards

Tomasz

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...