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 Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...