Dashboards & Visualizations

Splunk Classic XML dashboard display input type and HTML text side by side

nnkreddy
Explorer

I'm trying to display a simple input type and html text side by side but they are appearing vertically. I have tried few CSS options but none of them worked.

Sample Panel code

<panel id="panel1">

    <input type="text" token="tk1" id="tk1id" searchWhenChanged=“true”>
       <label>Refine further?</label>
       <prefix> | where </prefix>
    </input>

    <html id="htmlid">
        <p>count: $job.resultCount$</p>
    </html>

    <event>
        <search>
            .
            .
            .
            .
        </search>
    </event>
</panel>

How can I make input and html text appear side by side and events at the bottom? My requirement is to have this in achieved in single panel in XML dashboard. Thanks for any help!

Labels (2)
Tags (2)
0 Karma

nnkreddy
Explorer

Hi Will,

Thanks! That kind of worked but is there a way to have the html within same panel next to input without creating another panel? Its sort of didn’t align the panels correctly.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

<dashboard version="1.1" theme="light">
  <label>Events</label>
  <row>
    <panel id="panel1">
      <input type="text" token="tk1" id="tk1id" searchWhenChanged="true">
         <label>Refine further?</label>
         <prefix> | where </prefix>
      </input>
  
      <html id="htmlid">
          <p>count: $job.resultCount$</p>
      </html>      
      <event>
        <search>
          <query>index=_internal</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="list.drilldown">none</option>
      </event>
    </panel>
    <panel depends="$alwaysHide$">
      <html>
        <style>
          #panel1 .dashboard-panel {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
          }
        </style>
      </html>
    </panel>
  </row>
</dashboard>
0 Karma

nnkreddy
Explorer

Hi,

Thanks! This almost worked -  the alignment is now all rows including panel title, input text, html text and events. 
 
Is there a way to leave title as is and have just input and html tags side by side with events coming down to both of them? Now all of them are in a row with title, input, html and events all are next to next.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please share your current SimpleXML source demonstrating the issue.

0 Karma

livehybrid
Super Champion

Hi @nnkreddy 

Each of the objects you want to be next to each other horizontally need to be in <panel> within the same <row>.

This will produce something like below, is this what you are looking to achieve?

livehybrid_0-1740995734593.png

 

 

<form version="1.1" theme="light">
  <label>xmltest</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel id="input1">
      <input type="text" token="tk1" id="tk1id" searchWhenChanged="true">
        <label>Refine further?</label>
        <prefix> | where </prefix>
      </input>
      </panel>
      <panel id="html1">
      <html id="htmlid">
        <p>count: $job.resultCount$</p>
    </html>
    </panel>
</row>
  <row>
    <panel id="panel1">
      <table>
        <search>
          <query>|makeresults 
          | eval msg="test" | stats count by msg</query>
        </search>
        <option name="drilldown">cell</option>
      </table>
    </panel>
  </row>
</form>

 

Please let me know how you get on and consider adding karma to this or any other answer if it has helped.
Regards

Will

 

0 Karma
Get Updates on the Splunk Community!

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...

Splunk Answers Content Calendar, June Edition II

Get ready to dive into Splunk Dashboard panels this week! We'll be tackling common questions around ...

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...