Reporting
Highlighted

How to add a Splunk Report (saved search) inside the HTML tags?

Explorer

I have created inside an HTML tag a popup with the modal class.
However, I'm interested in showing a Report (saved search) on that popup.
I'm not sure how to add such a report inside the HTML tag.

        <div class="modal popup-body $tokShowModel$" id="myModal">
         <div class="modal-header popup-header">
            <h3>Show a report</h3>
            <div>
             <a id="anchorCloseModalWindow" class="btn btn-primary btn-position">x</a>
            </div>
         </div>
         <div class="modal-body">
         <h1>Report comes here<h1>
         </div>
        </div>
0 Karma
Highlighted

Re: How to add a Splunk Report (saved search) inside the HTML tags?

Legend

@saulcruzmendez, one simple approach would be to convert your saved search to scheduled search and enable Embedded Report (learn about the best practices to enable this).

https://docs.splunk.com/Documentation/Splunk/latest/Report/Embedscheduledreports

alt text

Then you can add the iframe code to your existing Modal Pop-up. Here is a sample code:

  <row>
    <panel>
      <html>
        <div class="modal popup-body $tokShowModel$" id="myModal">
          <div class="modal-header popup-header">
            <h3>Show a report</h3>
            <div>
              <a id="anchorCloseModalWindow" class="btn btn-primary btn-position">x</a>
            </div>
          </div>
          <div class="modal-body">
            <h1>Splunkd Error embedded as modal pop-up</h1>
            <div>
              <iframe height="400" width="480" frameborder="0" src="embedded_report_rest_uri_generated_after_converting_your_report_to_embedded_report"></iframe>
            </div>
          </div>
        </div>
      </html>
    </panel>
  </row>

Do try out and confirm.




| eval message="Happy Splunking!!!"


Highlighted

Re: How to add a Splunk Report (saved search) inside the HTML tags?

Explorer

@niketnilay

Thanks you for your answer. That could work but I need it to be a search on real time, not a schedule report. I have been looking around, and from what is looks like. I need to work on the modal window via JavaScript.

Highlighted

Re: How to add a Splunk Report (saved search) inside the HTML tags?

Explorer
Highlighted

Re: How to add a Splunk Report (saved search) inside the HTML tags?

Legend

@saulcruzmendez Go ahead and accept your own answer posted above. The reason why I had suggested Embedded Dashboards was to keep the complexity lower. However, if you are comfortable with Simple XML Extensions, you can try the following Splunk .Conf session by @jconger where Example 10 deals with Event Handler + Token + Table Cell Render + Modal + Splunk Web Framework to generate a chart as Modal pop-up exactly the same way as your requirement.

10 Tips, Tricks and Hacks for Better Dashboards in Splunk




| eval message="Happy Splunking!!!"


Highlighted

Re: How to add a Splunk Report (saved search) inside the HTML tags?

Explorer

@niketnilay Thank you for the link! I'll for sure watch the video session. I appreciate the help!

0 Karma