<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: V2 API - Easy way to count the number of entities in a tag? in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Easy-way-to-count-the-number-of-entities-in-a-tag/m-p/188691#M1934</link>
    <description>&lt;P&gt;You can use an entity selector on the&amp;nbsp;/api/v2/entities endpoint of the Monitored Entities API. &amp;nbsp;For example if you're looking for hosts with a specific tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type(HOST),tag("[context]key")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, if you're looking for hosts with a specific tag value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type(HOST),tag("[context]key:value")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;context is for specific types of tags like [Environment] or [Azure] and isn't needed if your tag does not have a context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The JSON returned will have a "totalCount" which is the number of entities with a tag or tag:value. &amp;nbsp;You can set your pagesize to 1 if all you're interested in is the total number of entities and not the list of entities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 17:29:18 GMT</pubDate>
    <dc:creator>mgome</dc:creator>
    <dc:date>2022-06-17T17:29:18Z</dc:date>
    <item>
      <title>V2 API - Easy way to count the number of entities in a tag?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Easy-way-to-count-the-number-of-entities-in-a-tag/m-p/188689#M1933</link>
      <description>&lt;P&gt;I am fairly accomplished in pulling back time series data in the V2 API, but my question is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A user could in fact specify a tag name that has thousands of entities tied to it. For example - "server:servername" versus just "server".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy was to pull back just the number of entities count for a particular tag?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use this as a pre-check safeguard to ensure my API will not try to pull back data for thousands of servers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lou&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 16:08:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Easy-way-to-count-the-number-of-entities-in-a-tag/m-p/188689#M1933</guid>
      <dc:creator>louis_gallo</dc:creator>
      <dc:date>2022-06-17T16:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: V2 API - Easy way to count the number of entities in a tag?</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Easy-way-to-count-the-number-of-entities-in-a-tag/m-p/188691#M1934</link>
      <description>&lt;P&gt;You can use an entity selector on the&amp;nbsp;/api/v2/entities endpoint of the Monitored Entities API. &amp;nbsp;For example if you're looking for hosts with a specific tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type(HOST),tag("[context]key")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or, if you're looking for hosts with a specific tag value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;type(HOST),tag("[context]key:value")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;context is for specific types of tags like [Environment] or [Azure] and isn't needed if your tag does not have a context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The JSON returned will have a "totalCount" which is the number of entities with a tag or tag:value. &amp;nbsp;You can set your pagesize to 1 if all you're interested in is the total number of entities and not the list of entities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 17:29:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/V2-API-Easy-way-to-count-the-number-of-entities-in-a-tag/m-p/188691#M1934</guid>
      <dc:creator>mgome</dc:creator>
      <dc:date>2022-06-17T17:29:18Z</dc:date>
    </item>
  </channel>
</rss>

