Dashboards & Visualizations

Using search results in html panel - partial working (v7.3.1)

apietersen
Contributor

Hi,
Want to embed a html page (html-file) as an iframe in a panel of a dashboard. Can not make it working, we use version 7.3.1 What do I wrong here?

Searched almost all docs and answer by no succes yet

apietersen

<dashboard>
  <label>variable-transfer</label>
  <init>
    <set token="err_page">https://mysplunkserver.nl/en-GB/static/</set>
  </init>
  <row>
    <panel>
      <title>Show the name of a valid helpfile</title>
      <table>
        <search>
          <query>| makeresults 
| eval msgcode="msgcode-46.html"
| fields msgcode
| return $msgcode</query>
          <earliest>$earliest$</earliest>
          <latest>$latest$</latest>
        </search>
        <option name="count">10</option>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
    <panel>
      <title>create a valid url string including <helpfile>.html directing to static directory</title>
      <html> 
          <div> 
          $err_page$  "Note: first part is OK but second part (filename) is NOT" $msgcode$

          </div>  
      </html>
    </panel>
  </row>
</dashboard>
Tags (2)
0 Karma

apietersen
Contributor

I think I found the solution: adding a set token directly after query

<dashboard>
  <label>variable-transfer</label>
  <init>
    <set token="err_page">https://mysplunkserver.nl/en-GB/static/</set>
  </init>
  <row>
    <panel>
      <title>Show the name of a valid helpfile</title>
      <table>
        <search>
          <query>| makeresults 
| eval msgcode="msgcode-46.html"
| table msgcode

</query>
    <done>
       <set token="file">$result.msgcode$</set>
     </done>
          <earliest>$earliest$</earliest>
          <latest>$latest$</latest>
        </search>

        <option name="count">10</option>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
    </row>
    <row>
    <panel>
      <title>create a valid url string including helpfile</title>
      <html> 
          <div> $err_page$$file$
          <iframe src="$err_page$$file$" width="100%" />

          </div>  
      </html>
    </panel>
  </row>
</dashboard>
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 ...