<?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: DQL through API in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284212#M2475</link>
    <description>&lt;P&gt;Thank you very much for your response, Deni, it was exactly what I needed. However, I believe Dynatrace is currently missing the capability to query data via DQL in real time.&lt;/P&gt;&lt;P&gt;We are looking to detect when a specific&amp;nbsp;userId&amp;nbsp;connects to a session and immediately trigger alerts. This is especially useful in financial contexts, where real-time awareness is critical. As it stands, the API only allows querying data nearly an hour after the event occurs, which prevents us from generating live alerts — particularly for sessions that may pose a security risk.&lt;/P&gt;&lt;P&gt;From my own experience, I’ve validated that Dynatrace provides enough information to profile a potential attacker. However, receiving that data with such a delay is not sufficient. Ideally, DQL queries via API should work in real time, just like the visual inspection of LIVE sessions. If it's possible to see this data live in the UI, I don’t understand why the same isn’t available through DQL via API.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 14:45:49 GMT</pubDate>
    <dc:creator>jmonroy</dc:creator>
    <dc:date>2025-08-19T14:45:49Z</dc:date>
    <item>
      <title>DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282340#M2380</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello, Dynatrace Community!&lt;/P&gt;
&lt;P&gt;I am trying to execute the following DQL (Dynatrace Query Language) query to retrieve user session data via the Dynatrace API:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;sql&lt;/DIV&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;
&lt;DIV class=""&gt;Copiar&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;select&lt;/SPAN&gt; &lt;SPAN class=""&gt;*&lt;/SPAN&gt; &lt;SPAN class=""&gt;FROM&lt;/SPAN&gt; usersession &lt;SPAN class=""&gt;WHERE&lt;/SPAN&gt; osFamily&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"Linux" &lt;SPAN class=""&gt;and&lt;/SPAN&gt; browserMajorVersion&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"Chrome 138" &lt;SPAN class=""&gt;and&lt;/SPAN&gt; screenOrientation&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"LANDSCAPE" &lt;SPAN class=""&gt;and&lt;/SPAN&gt; displayResolution&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"FHD" &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;Is it possible to execute this query directly through the Dynatrace API? If yes, could you please guide me on how to structure the API call properly, and whether any specific headers or parameters are needed to run DQL queries?&lt;/P&gt;
&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 06:50:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282340#M2380</guid>
      <dc:creator>jmonroy</dc:creator>
      <dc:date>2025-07-29T06:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282341#M2381</link>
      <description>&lt;P&gt;Is it possible to execute this query directly through the Dynatrace API? Additionally, can the query be executed for a specific time range, or should it return data for the whole day?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jul 2025 05:18:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282341#M2381</guid>
      <dc:creator>jmonroy</dc:creator>
      <dc:date>2025-07-26T05:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282342#M2382</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/93780"&gt;@jmonroy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your statement is &lt;SPAN&gt;User Sessions Query Language (AKA USQL) one,&amp;nbsp; and you can use it with&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/api-usql" target="_blank" rel="noopener"&gt;User sessions API&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Further information about USQL can be found in&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/usql-info" target="_blank" rel="noopener"&gt;Custom queries, segmentation, and aggregation of session data&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yos&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jul 2025 08:12:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282342#M2382</guid>
      <dc:creator>Yosi_Neuman</dc:creator>
      <dc:date>2025-07-26T08:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282349#M2383</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/93780"&gt;@jmonroy&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;You can use this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;curl -X &lt;/SPAN&gt;&lt;SPAN&gt;'GET'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;  &lt;SPAN&gt;'https://{environmentid}.live.dynatrace.com/api/v1/userSessionQueryLanguage/table?query=select%20%2A%20FROM%20usersession%20WHERE%20osFamily%3D%22Linux%22%20and%20browserMajorVersion%3D%22Chrome%20138%22%20and%20screenOrientation%3D%22LANDSCAPE%22%20and%20displayResolution%3D%22FHD%22&amp;amp;addDeepLinkFields=false&amp;amp;explain=false'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;SPAN&gt;  -H &lt;/SPAN&gt;&lt;SPAN&gt;'accept: application/json'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;SPAN&gt;  -H &lt;/SPAN&gt;&lt;SPAN&gt;'Authorization: Api-Token XXXX'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About the time - yes, you can:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;curl -X &lt;/SPAN&gt;&lt;SPAN&gt;'GET'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;  &lt;SPAN&gt;'https://{environmentid}.live.dynatrace.com/api/v1/userSessionQueryLanguage/table?query=select%20%2A%20FROM%20usersession%20WHERE%20osFamily%3D%22Linux%22%20and%20browserMajorVersion%3D%22Chrome%20138%22%20and%20screenOrientation%3D%22LANDSCAPE%22%20and%20displayResolution%3D%22FHD%22&amp;amp;startTimestamp=1753569000&amp;amp;addDeepLinkFields=false&amp;amp;explain=false'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;SPAN&gt;  -H &lt;/SPAN&gt;&lt;SPAN&gt;'accept: application/json'&lt;/SPAN&gt;&lt;SPAN&gt; \&lt;/SPAN&gt;&lt;SPAN&gt;  -H &lt;/SPAN&gt;&lt;SPAN&gt;'Authorization: Api-Token XXX'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;You can see the full list of parameters in the swagger UI:&lt;BR /&gt;1. Go to Dynatrace old UI&lt;/P&gt;&lt;P&gt;2. Click on your profile in the upper right corner.&lt;/P&gt;&lt;P&gt;3. Select Environment API v1&lt;/P&gt;&lt;P&gt;4. Check Rum - User Sessions API&lt;/P&gt;&lt;P&gt;Regards, Deni&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;H3 id="operations-tag-RUM_-_User_sessions"&gt;&amp;nbsp;&lt;/H3&gt;</description>
      <pubDate>Sat, 26 Jul 2025 19:12:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/282349#M2383</guid>
      <dc:creator>deni</dc:creator>
      <dc:date>2025-07-26T19:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284212#M2475</link>
      <description>&lt;P&gt;Thank you very much for your response, Deni, it was exactly what I needed. However, I believe Dynatrace is currently missing the capability to query data via DQL in real time.&lt;/P&gt;&lt;P&gt;We are looking to detect when a specific&amp;nbsp;userId&amp;nbsp;connects to a session and immediately trigger alerts. This is especially useful in financial contexts, where real-time awareness is critical. As it stands, the API only allows querying data nearly an hour after the event occurs, which prevents us from generating live alerts — particularly for sessions that may pose a security risk.&lt;/P&gt;&lt;P&gt;From my own experience, I’ve validated that Dynatrace provides enough information to profile a potential attacker. However, receiving that data with such a delay is not sufficient. Ideally, DQL queries via API should work in real time, just like the visual inspection of LIVE sessions. If it's possible to see this data live in the UI, I don’t understand why the same isn’t available through DQL via API.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 14:45:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284212#M2475</guid>
      <dc:creator>jmonroy</dc:creator>
      <dc:date>2025-08-19T14:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284232#M2479</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/93780"&gt;@jmonroy&lt;/a&gt; This is a very interesting point.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;From what I know, this API works only with &lt;STRONG&gt;closed sessions&lt;/STRONG&gt;. I assume it was designed this way (which makes sense to me), because most of the session parameters — such as called actions, durations, business events, etc. — can still change while the session is alive. Only static attributes like sessionId and userId remain fixed. Allowing queries on open sessions could compromise analytics consistency and lead to inaccurate results.&lt;/P&gt;&lt;P&gt;That said, since data about live sessions &lt;EM&gt;is&lt;/EM&gt; visible in the UI, it obviously has to be stored somewhere. It’s possible that this is also in Grail (I’m not certain), but it seems this data cannot be accessed through the API directly. Personally, I would start exploring this through &lt;STRONG&gt;DQL in Notebooks&lt;/STRONG&gt; to see what’s feasible.&lt;/P&gt;&lt;P&gt;I can’t give you a definitive answer to your use case yet, but I agree it’s a very important scenario — especially in contexts like financial services where real-time user activity can indicate potential security risks. I’ll experiment further on my side, and if I discover a solution I’ll share it here. Meanwhile, if you come across any workaround or approach, please do the same &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 22:20:28 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284232#M2479</guid>
      <dc:creator>deni</dc:creator>
      <dc:date>2025-08-19T22:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: DQL through API</title>
      <link>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284245#M2480</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/93780"&gt;@jmonroy&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/90225"&gt;@deni&lt;/a&gt;&amp;nbsp;- RUM (as it is now) was not designed for real time business analytics, although it is possible to use it for this purpose to some degree. If you need real-time data, &lt;A href="https://docs.dynatrace.com/docs/shortlink/business-analytics-hub" target="_blank"&gt;bizevents&lt;/A&gt; is the path (SaaS only), it fits such use cases much better. Querying live session data will be available with the upcoming &lt;A href="https://docs.dynatrace.com/docs/shortlink/new-rum-experience" target="_blank"&gt;RUM in Grail.&lt;/A&gt;&amp;nbsp;(SaaS only).&lt;BR /&gt;&lt;BR /&gt;For Dynatrace Managed, the answer depends on particular use cases. I'd recommend focusing on your own Application metrics or USQL metrics (but those are calculated after the session is closed).&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 06:43:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/DQL-through-API/m-p/284245#M2480</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2025-08-20T06:43:58Z</dc:date>
    </item>
  </channel>
</rss>

