Dashboards & Visualizations

Input fields in view

stwong
Communicator

Hi,

I'm trying to create a view looks like following:

[input ipaddr]         [dropdown list]
[input username]       [Time selector]

I add following code, but all boxes are in the same line. I tried <br></br> or <br/> but didn't work.

<input type="text" token="ipaddr">
  <default>*</default>
</input>
<input type="dropdown" token="bool"> 
        <label></label>
        <choice value="OR">OR</choice>
        <choice value="AND">AND</choice>
        <default>AND</default>
   </input>
  <input type="text" token="username">
    <default>*</default>
  </input>
        <input type="time">
  <default>Last 7 days</default>
</input>

  </fieldset>

Would anyone help? I'm new to Splunk and web programming. Sorry for the newbie question. Thanks a lot.

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You can organize your fields in rows and panels like this:

<form>
  <label>fields</label>
  <description/>
  <row>
    <panel>
      <input type="text" token="field1"/>
      <input type="text" token="field2"/>
    </panel>
  </row>
  <row>
    <panel>
      <input type="text" token="field3"/>
      <input type="time" token="field4">
        <label/>
        <default>
          <earliestTime>0</earliestTime>
          <latestTime/>
        </default>
      </input>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <searchString>| stats count | eval field1="$field1$" | eval field2="$field2$" | eval field3="$field3$" | addinfo</searchString>
        <earliestTime>$field4.earliest$</earliestTime>
        <latestTime>$field4.latest$</latestTime>
      </table>
    </panel>
  </row>
</form>

alt text

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You can organize your fields in rows and panels like this:

<form>
  <label>fields</label>
  <description/>
  <row>
    <panel>
      <input type="text" token="field1"/>
      <input type="text" token="field2"/>
    </panel>
  </row>
  <row>
    <panel>
      <input type="text" token="field3"/>
      <input type="time" token="field4">
        <label/>
        <default>
          <earliestTime>0</earliestTime>
          <latestTime/>
        </default>
      </input>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <searchString>| stats count | eval field1="$field1$" | eval field2="$field2$" | eval field3="$field3$" | addinfo</searchString>
        <earliestTime>$field4.earliest$</earliestTime>
        <latestTime>$field4.latest$</latestTime>
      </table>
    </panel>
  </row>
</form>

alt text

martin_mueller
SplunkTrust
SplunkTrust

Take them out of the <fieldset> tag and put them in <row><panel> tags instead. Start a new <row> as needed.

stwong
Communicator

Thanks for your help. Anyway, seems the behavior is different if i put the inputs in fieldset in my view, e.g.

<fieldset>
 <input type="text" token="ipaddr">
  <default>*</default>
 </input>
 <input type="dropdown" token="bool"> 
  <label></label>
  <choice value="OR">OR</choice>
  <choice value="AND">AND</choice>
  <default>AND</default>
 </input>
 <input type="text" token="username">
  <default>*</default>
 </input>
 <input type="time">
  <default>Last 7 days</default>
 </input>
</fieldset>

Would you help? Thanks again.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...