# Negate Multiple IBM MQ Local Queues in the Entity Selector

**URL:** <https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255>\
**Category:** Extensions\
**Tags:** tagging, extensions, ibm-mq\
**Created:** [August 22, 2024, 5:26am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255 "2024-08-22T05:26:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [August 22, 2024, 5:26am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/1 "2024-08-22T05:26:40Z")

</div>

Dear All,

How can we negate multiple&nbsp;IBM MQ local queues in the entity selector while applying automatic tagging?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [August 22, 2024, 6:49am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/2 "2024-08-22T06:49:43Z")

</div>

Hi&nbsp;[@Babar\_Qayyum](https://community.dynatrace.com/user/22017)&nbsp;,

I suggest trying one of the following sample queries:

1. type(ibmmq:local\_queue), entityName.in(“queue1”, “queue2”), not(entityName.in(“queue3”, “queue4”))
2. type(ibmmq:local\_queue), not(entityName.in(“queue3”, “queue4”))

While I haven’t tested these with the IBM MQ extension, they worked well for me with a standard message queue. Please test these queries and let me know if they work for you.

For reference, here are similar queries using a generic QUEUE type:

1. type(QUEUE), entityName.in(“queue1”, “queue2”), not(entityName.in(“queue3”, “queue4”))
2. type(QUEUE), not(entityName.in(“queue3”, “queue4”))

Best Regards,

Mohamed

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [August 22, 2024, 7:08am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/3 "2024-08-22T07:08:00Z")

</div>

Hello&nbsp;[@Mohamed\_Hamdy](https://community.dynatrace.com/user/4007)

I was playing around with this one&nbsp;not(entityName.in, but it did not work in my case. I want to eliminate backout queues as a wild mask and others as queue names. The wild mask works only with the&nbsp; **entityName** as the value operator contains, but it does not accept the multiple values.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [August 22, 2024, 3:55pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/4 "2024-08-22T15:55:25Z")

</div>

Hו&nbsp;[@Babar\_Qayyum](https://community.dynatrace.com/user/22017)&nbsp; &&nbsp;[@Mohamed\_Hamdy](https://community.dynatrace.com/user/4007)

The follows work for me at customer site yesterday for metric selector:

```python
ibmmq.queue.depth
:filter(in("dt.entity.ibmmq:local_queue", 
entitySelector("
    type(~"ibmmq:local_queue~"),
    queue_manager(~"AAA.XXX.QMGR~"), 
    not(entityName.startsWith(~"QL.DMZ.COMPRETAIL.TO.PORTAL.INTERNET~")),
    not(entityName.startsWith(~"QL.DMZ.COMPRETAIL.TO.RETAIL~"))
    ")))
:splitBy("dt.entity.ibmmq:local_queue")

```

and for Tag by entity selector

```python
type("ibmmq:local_queue"),
queue_manager("AAA.BBB.QMGR"),
not(entityName.startsWith("QL.DMZ.COMPRETAIL.TO.PORTAL.INTERNET")),
not(entityName.startsWith("QL.DMZ.COMPRETAIL.TO.RETAIL"))

```

HTH

Yos

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [August 22, 2024, 4:33pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/5 "2024-08-22T16:33:18Z")

</div>

Hello&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)

Thank you for your comments. It worked for me.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [January 30, 2025, 8:21am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/6 "2025-01-30T08:21:26Z")

</div>

Hello&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;[@Mohamed\_Hamdy](https://community.dynatrace.com/user/4007)

What issues exist with the current entity selector intended for implementing auto tagging?

type(“ibmmq:channel”),queue\_manager(“ABCD”),entityName(“XYZ”)

**entitySelector Predicate name ‘queue\_manager’ not applicable for type ibmmq:channel**

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Mohamed\_Hamdy](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Mohamed\_Hamdy](https://community.dynatrace.com/u/Mohamed_Hamdy)\
**Post date:** [January 30, 2025, 12:40pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/7 "2025-01-30T12:40:23Z")

</div>

Hi&nbsp;[@Babar\_Qayyum](https://community.dynatrace.com/user/22017)&nbsp;,

I think you can use the following

type(“ibmmq:queue\_manager”),entityName(“ABCD”)

Regards,

Hamdy

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [February 2, 2025, 4:11am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/8 "2025-02-02T04:11:01Z")

</div>

Dear&nbsp;[@Mohamed\_Hamdy](https://community.dynatrace.com/user/4007)

Thank you for your comments.

I wish to assign tags to specific&nbsp; **channels** on specific **queue managers**.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![pieter\_luttig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pieter_luttig/32/37241_2.png) [@pieter\_luttig](https://community.dynatrace.com/u/pieter_luttig)\
**Post date:** [February 7, 2025, 1:00pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/9 "2025-02-07T13:00:37Z")

</div>

Hi&nbsp;[@Babar\_Qayyum](https://community.dynatrace.com/user/22017)&nbsp;did you come right with this?

I am struggling with the same thing, tagging specific IBM MQ Channels with entity selector

Regards,

Pieter

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [February 7, 2025, 3:05pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/10 "2025-02-07T15:05:59Z")

</div>

Hello&nbsp;[@pieter\_luttig](https://community.dynatrace.com/user/30846)

I successfully implemented a workaround by utilizing an auto tag for specific channels. This allowed me to filter by the tag and the name of a queue manager to present a tile on the dashboard.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![pieter\_luttig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pieter_luttig/32/37241_2.png) [@pieter\_luttig](https://community.dynatrace.com/u/pieter_luttig)\
**Post date:** [February 10, 2025, 4:01pm UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/11 "2025-02-10T16:01:36Z")

</div>

[@Babar\_Qayyum](https://community.dynatrace.com/user/22017), Ah yes if you do have a list of the specific channels then you can do a Monitored entity rule type that applies to custom devices where the name matches the channel names.

However, I was more interested in auto-tagging ALL channels living on specific queue managers. But I guess the relationship between channels and queue\_managers does not exist. (&nbsp; Although interesting enough, the&nbsp;IBM MQ extension content says “ibmmq:channel() is child of ibmmq:queue\_manager()”&nbsp; )

Example of what I am trying:

```javascript
type(ibmmq:channel), queue_manager(queue_manager1,queue_manager2)

```

entitySelector Predicate name ‘queue\_manager’ not applicable for type ibmmq:channel

Or

```java
type(ibmmq:channel), fromRelationship.runsOn(type(ibmmq:queue_manager),entityName.in(queue_manager1,queue_manager2))

```

Regards,

Pieter

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [February 11, 2025, 4:22am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/12 "2025-02-11T04:22:18Z")

</div>

Hello&nbsp;[@pieter\_luttig](https://community.dynatrace.com/user/30846)

Exactly, the child relationship is not functioning as anticipated, as outlined in the documentation.

I implemented auto-tagging for designated channels and filtered the results using specific queue managers.

type(“ibmmq:channel”),entityName.in(“channel01”, “channel01”, “channel01”)

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![pieter\_luttig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pieter_luttig/32/37241_2.png) [@pieter\_luttig](https://community.dynatrace.com/u/pieter_luttig)\
**Post date:** [March 7, 2025, 8:51am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/13 "2025-03-07T08:51:45Z")

</div>

Hi [@Babar\_Qayyum](https://community.dynatrace.com/user/22017), thought I’d quickly share with you. It turns out the child relationship does exist:laughing:. You can use the below query to show all channels living on a particular queue manager. This way you can keep your auto-tag dynamically up-to-date.

```auto
type(ibmmq:channel),fromRelationships.isChildOf(type(ibmmq:queue_manager),entityName.equals("QMGRname"))

```

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [March 9, 2025, 6:47am UTC](https://community.dynatrace.com/t/negate-multiple-ibm-mq-local-queues-in-the-entity-selector/47255/14 "2025-03-09T06:47:11Z")

</div>

Hello&nbsp;[@pieter\_luttig](https://community.dynatrace.com/user/30846)

Thank you for your comments. The requirement is to tag a particular channel /or channels for particular queue managers.

Regards,

Babar
