cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dashboard filter with multi-select: filtering on multiple possible tags

aled
Visitor

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:aws: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

6 REPLIES 6

GerardJ
Advisor

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

Gerard

Not sure how I missed that, works well, cheers!

Kenny_Gillette
DynaMight Leader
DynaMight Leader

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?

Dynatrace Certified Professional

@GerardJ  any help you could provide please

Dynatrace Certified Professional

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)

 

Gerard

Thanks so much.  Got this working now.  

Dynatrace Certified Professional

Featured Posts