Getting Data In

how to use comparison sign in a token filter

jip31
Motivator

hello

I would like to know how to use comparison sign in a input text filter??
thanks

0 Karma
1 Solution

vnravikumar
Champion

Hi

Try this and enter textbox filter with for example >=4

<form>
  <label>condition</label>
  <fieldset submitButton="false">
    <input type="text" token="field">
      <label>test</label>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval test="1,2,3,4,5,6,7,8,9,10" 
| makemv delim="," test 
| mvexpand test |search test $field$ |table test</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Try this and enter textbox filter with for example >=4

<form>
  <label>condition</label>
  <fieldset submitButton="false">
    <input type="text" token="field">
      <label>test</label>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults 
| eval test="1,2,3,4,5,6,7,8,9,10" 
| makemv delim="," test 
| mvexpand test |search test $field$ |table test</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>
0 Karma

harshpatel
Contributor

can you please elaborate more on what you what to do?

0 Karma

jip31
Motivator

As you can see in my search I use 2 filters.
Actually I m forced to type an exact value If i want to display results with my filter
I would like to have a more dynamic filter
example : instead to enter 20 I would like to be able to type > or = 20

| inputlookup host.csv
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT BatteryTemp00 BatteryModel00 CycleCount00 HealthState00 LastRecalibration00 ManufactureDate00
| search HealthState00=$tok_health$
| search CycleCount00=$tok_cycle$
| table host BatteryModel00 BatteryTemp00 CycleCount00 HealthState00 LastRecalibration00 ManufactureDate00
| sort +host

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 ...