0

I have created a dashboard which has few input pickers and different panels. When I export to PDF, only the charts are getting exported. I need the URL getting generated on clicking the "Open Search" button available at the right bottom of interactive chart needs to get exported to PDF.

If possible the queries needs to be invisible in splunk dashboard.

Thanks in advance.

aruma
  • 123
  • 12

1 Answers1

1

You can include the value of the tokens in a html panel, which can be used to then show the query that is being run. Take a look at the following example.

<form>
  <label>SO Test</label>
  <fieldset submitButton="true">
    <input type="text" token="idx">
      <label>Index</label>
      <default>*</default>
    </input>
  </fieldset>
  <row>
    <html>
      <pre>index=$idx$ | stats count by source</pre>
    </html>
  </row>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=$idx$ | stats count by source</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
  </row>
</form>

PDF screenshot

In your case, you may have multiple panels, and each panel may have a different query. You can use multiple html elements, or just put the values of the token at the start.

Simon Duff
  • 2,631
  • 2
  • 7
  • 15
  • I need to get the resolved query printed in the PDF exported. can you explain a bit how to get it? – aruma Jan 29 '20 at 17:35
  • index=$idx$ | stats count by source
    – Simon Duff Jan 29 '20 at 21:03
  • I have added an extra row to the dashboard, which includes a html tag. In side the tag, I just have the query that I am running, with the tokens ($idx$), in there. Splunk will replace these with the value of the input pickers. When you create the PDF, the resolved query will be printed – Simon Duff Jan 29 '20 at 21:05
  • Perhaps you should provide the source code of your dashboard. Remember, each dashboard panel you include will/may have a different query that is run. So be clear what you are asking. – Simon Duff Jan 29 '20 at 21:07
  • thanks Simon Duff. tag actually prints the query in the dashboard too. I am updating the question. – aruma Jan 30 '20 at 22:44