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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...