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!

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...