Quantcast
Channel: Latest Questions on Splunk Answers
Viewing all articles
Browse latest Browse all 13053

Dynamically Appending OR Clauses Based on Form Input

$
0
0

Based on form input (e.g. the state of multiple checkboxes) I would like to build a search query comprised of multiple OR clauses. For example: Given 3 checkboxes: "USA", "Canada", "Mexico", I'd like to dynamically build a query that contains any of the above countries, like so:

source="abc" country="USA" OR country="Canada" OR country="Mexico"

If, for example, the "Canada"checkbox is unchecked, the country's name will be omitted from the search query, like so:

source="abc" country="USA" OR country="Mexico"

What would be the correct mechanism to use to achieve this functionality?


Viewing all articles
Browse latest Browse all 13053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>