Getting Data In

How do I set choice value if I need fields where value is greater than zero?

almar_cabato
New Member

I tried below:

<input type="radio" token="duration.input" searchWhenChanged="true">
  <label>Call Duration</label>
  <choice value=">0">Non-Zero</choice>
  <choice value="0">Zero</choice>
  <choice value="*">All</choice>
  <default>All</default>
</input>


             sourcetype=callrecords
              duration="$duration.input$"
              | table field1, field2, field3
      </query>

I cannot get this working when I choose "Non-Zero."

Thanks a lot.

Tags (1)
0 Karma

ktugwell_splunk
Splunk Employee
Splunk Employee

Hi Almar,

You've got a couple of options here:

You can either use the token prefix and place a search or where command in there, or do something like this:

<form>
  <label>Test1</label>
  <fieldset submitButton="false">
    <input type="radio" token="values_token">
      <label>Values</label>
      <choice value="where count=0">Zero</choice>
      <choice value="where count!=0">Non-Zero</choice>
      <choice value="where isnotnull(count)">All</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>Results</title>
        <search>
          <query>| makeresults count=10 |   streamstats count | eval count=count-1 | $values_token$</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>

almar_cabato
New Member

Thanks, let me try it.

Regards,
Almar

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...