<?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: Looking to get help with DQL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Looking-to-get-help-with-DQL/m-p/246558#M928</link>
    <description>&lt;P&gt;If I understand the need correctly and to introduce minimal changes to the query, I would add only this line to it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| summarize {cnt=count(), firstLogin=takeMin(timestamp), lastLogin=takeMax(timestamp)}, by:{UserId}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as a additional advice, attention needs to be paid to result size of subqueries (in this case in "join [&amp;lt;subquery&amp;gt;]"). If result size it too big, query will fail. In this case use of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;dedup&lt;/STRONG&gt;&lt;/EM&gt; or &lt;EM&gt;&lt;STRONG&gt;summarize&lt;/STRONG&gt;&lt;/EM&gt; inside increases chances for success, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents, from:now()-1h
| filter (event.type == "salesforce.LoginEvent" AND Application == "Browser")
| filter UserId in [
    fetch logs, from:now()-1d
    | filter dt.system.bucket == "monitoring_user_list"
    | filter contains(attributes, "user")
    | dedup id
    | fields id
]
| summarize {cnt=count(), firstLogin=takeMin(timestamp), lastLogin=takeMax(timestamp)}, by:{UserId}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
    <pubDate>Sat, 25 May 2024 08:27:15 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2024-05-25T08:27:15Z</dc:date>
    <item>
      <title>Looking to get help with DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Looking-to-get-help-with-DQL/m-p/246430#M924</link>
      <description>&lt;P&gt;I am using Dynatrace to monitor Salesforce using Salesforce Insight app connector.&lt;/P&gt;
&lt;P&gt;I have a scheduled workflow which scans BIZEVENTS to find list of specific user's login count in last 1 hr.&lt;/P&gt;
&lt;P&gt;The query I have is:&lt;/P&gt;
&lt;P&gt;fetch bizevents, from:now()-1h&lt;BR /&gt;| filter (event.type == "salesforce.LoginEvent" AND Application == "Browser")&lt;BR /&gt;| join [ fetch logs, from:now()-1d&lt;BR /&gt;| filter dt.system.bucket == "monitoring_user_list"&lt;BR /&gt;| filter contains(attributes, "user")], on:{left[UserId] == right[id]}&lt;/P&gt;
&lt;P&gt;So we nee to monitor only users stored in "monitoring_user_list" and I am doing a join to get only those login events where user already exists in "monitoring_user_list".&lt;/P&gt;
&lt;P&gt;But I also need to find how many times these users already found in above query logged-in as well (salesforce.LoginEvent - Dynatrace get this event bizevent data when someone login to Salesforce).&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 09:39:22 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Looking-to-get-help-with-DQL/m-p/246430#M924</guid>
      <dc:creator>MAYUMUKHERJEE</dc:creator>
      <dc:date>2024-05-24T09:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Looking to get help with DQL</title>
      <link>https://community.dynatrace.com/t5/DQL/Looking-to-get-help-with-DQL/m-p/246558#M928</link>
      <description>&lt;P&gt;If I understand the need correctly and to introduce minimal changes to the query, I would add only this line to it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| summarize {cnt=count(), firstLogin=takeMin(timestamp), lastLogin=takeMax(timestamp)}, by:{UserId}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as a additional advice, attention needs to be paid to result size of subqueries (in this case in "join [&amp;lt;subquery&amp;gt;]"). If result size it too big, query will fail. In this case use of&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;dedup&lt;/STRONG&gt;&lt;/EM&gt; or &lt;EM&gt;&lt;STRONG&gt;summarize&lt;/STRONG&gt;&lt;/EM&gt; inside increases chances for success, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch bizevents, from:now()-1h
| filter (event.type == "salesforce.LoginEvent" AND Application == "Browser")
| filter UserId in [
    fetch logs, from:now()-1d
    | filter dt.system.bucket == "monitoring_user_list"
    | filter contains(attributes, "user")
    | dedup id
    | fields id
]
| summarize {cnt=count(), firstLogin=takeMin(timestamp), lastLogin=takeMax(timestamp)}, by:{UserId}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 08:27:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Looking-to-get-help-with-DQL/m-p/246558#M928</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-05-25T08:27:15Z</dc:date>
    </item>
  </channel>
</rss>

