Dashboards & Visualizations

Drilldown to url to display in iframe

jaimerader
Engager

Hello all! I have a dashboard table that has multiple values, one of which being urls. Im trying to pass the value of the url to an iframe on the dashboard and have it display the contents of the url in the iframe when the row is clicked. When a different url is clicked it would then switch to that page. Is this possible??

0 Karma
1 Solution

renjith_nair
SplunkTrust
SplunkTrust

@jaimerader,

It's possible with the tokens.

Here is a run anywhere example

  1. init is set to load local splunk installation. You could set this to default url
  2. Two static urls are set with dummy search. This could be your search result
  3. On drill down set the tokUrl token to clicked row's url value

    <dashboard>
      <label>URLs in Iframe</label>
      <init>
        <set token="tokUrl">http://localhost:8000/en-US/app/launcher/home</set>
      </init>
      <row>
        <panel>
          <table>
            <search>
              <query>|makeresults|eval url="https://answers.splunk.com/index.html http://localhost:8000/en-US/app/search/urls_in_iframe"|makemv url| mvexpand url</query>
              <earliest>-15m</earliest>
              <latest>now</latest>
            </search>
            <option name="count">10</option>
            <option name="drilldown">cell</option>
            <drilldown>
              <set token="tokUrl">$row.url$</set>
            </drilldown>
          </table>
        </panel>
      </row>
      <row>
        <html>
          <h3>
            Displayiing content of $tokUrl$
          </h3>
          <body>
            <iframe src="$tokUrl$" width="100%" height="300">
            </iframe>
          </body>
        </html>
      </row>
    </dashboard>
    

Output
alt text

Happy Splunking!

View solution in original post

0 Karma

renjith_nair
SplunkTrust
SplunkTrust

@jaimerader,

It's possible with the tokens.

Here is a run anywhere example

  1. init is set to load local splunk installation. You could set this to default url
  2. Two static urls are set with dummy search. This could be your search result
  3. On drill down set the tokUrl token to clicked row's url value

    <dashboard>
      <label>URLs in Iframe</label>
      <init>
        <set token="tokUrl">http://localhost:8000/en-US/app/launcher/home</set>
      </init>
      <row>
        <panel>
          <table>
            <search>
              <query>|makeresults|eval url="https://answers.splunk.com/index.html http://localhost:8000/en-US/app/search/urls_in_iframe"|makemv url| mvexpand url</query>
              <earliest>-15m</earliest>
              <latest>now</latest>
            </search>
            <option name="count">10</option>
            <option name="drilldown">cell</option>
            <drilldown>
              <set token="tokUrl">$row.url$</set>
            </drilldown>
          </table>
        </panel>
      </row>
      <row>
        <html>
          <h3>
            Displayiing content of $tokUrl$
          </h3>
          <body>
            <iframe src="$tokUrl$" width="100%" height="300">
            </iframe>
          </body>
        </html>
      </row>
    </dashboard>
    

Output
alt text

Happy Splunking!
0 Karma

jaimerader
Engager

Absolutely perfect! Thank you!!

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