28 Jun 2024 09:19 AM
I have a variable definition working fine, that spits out possible values for a specific tag on my AWS SQS queues:
fetch `dt.entity.cloud
sqs`
| fields tags
| expand tags
| filter contains(tags, "[AWS]environment")
| sort tags asc
| summarize environments = collectDistinct(tags)
and this variable is configured as multi-select
I now want to filter for any entity matching one of the selected tags, but I'm not sure how to go about that
I've tried using `| filter tags in` to no avail
Solved! Go to Solution.
28 Jun 2024 10:57 AM
Hi @aled
That's what I use when I want to filter using multi-select variable, like this :
| filter in(tags, Array($variable))
Hope this helps
28 Jun 2024 11:03 AM
Not sure how I missed that, works well, cheers!
24 Mar 2025 04:08 PM
Wonder if I could get some help.
Trying to filter on Tag too. I have a variable that works to pulls part of tag
I pull the name of the business owner team through a variable named BOT.
fetch dt.entity.host
| fieldsAdd tags
| expand tags
| filter contains (tags, "[AWS]business-owner-team",caseSensitive:false)
| summarize tags = collectDistinct(tags)
| expand tags
| parse tags, "ld:'[AWS]business-owner-team' ':' ld:TagValue"
| sort TagValue asc
| fields TagValue
When I used above as variable in dashboard tile:
fetch dt.entity.host
| filter in(tags, Array($BOT))
I get nothing. any help?
26 Mar 2025 12:42 PM
@GerardJ any help you could provide please
27 Mar 2025 01:00 PM - edited 27 Mar 2025 02:25 PM
Hi @Kenny_Gillette
The 'in' function perform an exact match, so assuming that your variable is a multiselect, I would have this logic :
fetch dt.entity.host
| expand tags
| filter matchesValue(tags, "[AWS]business-owner-team*")
| parse tags, "ld:'[AWS]business-owner-team' ':' ld:TagValue"
| filter in(TagValue, $BOT)
27 Mar 2025 02:16 PM
Thanks so much. Got this working now.