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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...