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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...