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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...