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
SplunkTrust
SplunkTrust

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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...