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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...