- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a search query that takes a search value from a drop down.
Example
Drop down has values
All
A
B
Query uses
| where productType="$dropdown$"
How do I remove the where clause if All is selected. There is no productType - All
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


You can't remove code from SPL based on input. Nor does SPL allow for conditional execution. The solution is to set the "All" value of $dropdown$ to a value that is valid for all productType values. Often, this is "*". It may be necessary to change where to search.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much, replaced where with search and that worked like a charm
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


Hi @merc14,
probably you're meaning that you could have events without the productType, obviously these events aren't matched by the All (*) value.
You could modify the input adding an additiona static value to search the events without productType.
If you could share the input code, I can be more detailed.
Ciao.
Giuseppe
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


You can't remove code from SPL based on input. Nor does SPL allow for conditional execution. The solution is to set the "All" value of $dropdown$ to a value that is valid for all productType values. Often, this is "*". It may be necessary to change where to search.
If this reply helps you, Karma would be appreciated.
