# using startsWith in entity selector

**URL:** <https://community.dynatrace.com/t/using-startswith-in-entity-selector/37244>\
**Category:** Open Q&A\
**Tags:** databases, mssql, tagging, problems-classic\
**Created:** [November 11, 2022, 9:19am UTC](https://community.dynatrace.com/t/using-startswith-in-entity-selector/37244 "2022-11-11T09:19:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonatay](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@leonatay](https://community.dynatrace.com/u/leonatay)\
**Post date:** [November 11, 2022, 9:19am UTC](https://community.dynatrace.com/t/using-startswith-in-entity-selector/37244/1 "2022-11-11T09:19:42Z")

</div>

Hi community,

I want to configure a tag that selects mssql db instance and EXCLUDES db instances from specific **server** instance beginning with certain alphabets (for custom alerting purposes). In attribute seems like there is no startswith() option.

Have anyone have experience regarding this?

For now my entity selector looked like this:

**type(dt.entity.sql:sql\_server\_database), not(Device(“VCENxxx”))**

which i keyed in the full name of the device.

Was wondering if I can have a startswith option.

 ![leonatay_0-1668157871337.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/3/3320cb8c13dc921695bc5957dbf83a8916426e0f.png)

Thank you.

Sincerely,

Leona

---

<div class="post-metadata">

**Author:** ![Ingrida](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ingrida/32/13926_2.png) [@Ingrida](https://community.dynatrace.com/u/Ingrida)\
**Post date:** [November 11, 2022, 5:35pm UTC](https://community.dynatrace.com/t/using-startswith-in-entity-selector/37244/2 "2022-11-11T17:35:37Z")

</div>

Hi Leona,

At least on our cluster (Dynatrace Managed, 1.248) we do not have entity type “dt.entity.sql:sql\_server\_database”.&nbsp; Are your sure you do?

We actually work quite a lot with entitySelector for Management Zone definition (f.e. include all queues or all databases which are related to services from this management zone) or for custom tagging (tag all services which run on process group with these tags and entity name which starts with this and contains that). And it works. Example:

```markup
type(SERVICE),serviceType(DATABASE_SERVICE),softwareTechnologies(MICROSOFT_SQL_SERVER),not(entityName.startsWith("EV"))

```

Asks all services which are MS SQL databases and name does not starts with EV. Output:

```markup
{
  "totalCount": 155,
  "pageSize": 200,
  "entities": [
    {
      "entityId": "SERVICE-076BDC9E1A05DB5A",
      "type": "SERVICE",
      "displayName": "SpiraTest",
      "properties": {
        "softwareTechnologies": [
          {
            "type": "MICROSOFT_SQL_SERVER"
          },
          {
            "type": "DOTNET",
            "edition": ".NET Framework",
            "version": "4.6.2.0"
          }
        ]
      }
    },
...

```

(we do not have mysql oon the system…)

Regards,

Ingrida
