Dashboards & Visualizations

How to generate a "less than" filter in a dashboard?

qxu5715
Explorer

I want to build a dashboard with a text input as a filter, that shows all values in a field which are less than XX. I wanna do it with a textbox as input, cause the column includes values between 0 and 1677215.

e.g.: If i write 20000 in the textbox, the dashboard should show me all values less (or equal) 20000.

I've tried to escape the "<" expression with "& lt;" , but that didn't work (the space between & and l is, of course, not in my sourcode, but just here).

0 Karma

renjith_nair
Legend

Hi @qxu5715,

This is a run anywhere example

<dashboard>
  <label>Test1</label>
  <fieldset submitButton="false">
    <input type="text" token="limit" searchWhenChanged="true">
      <label>limit</label>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_*|stats count by sourcetype|where count<$limit$</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

niketn
Legend

@qxu5715 for us to assist you better please provide little bit more detail of what you have tried. What is the Simple XML code for Text Box and Search Query you are using.

Please mask/anonymize any sensitive information that you may have!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi qxu5715,
in your code use &lt; instead <
Bye.
Giuseppe

Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...