<?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: Parsing URL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300145#M3368</link>
    <description>&lt;P&gt;With parsing command would be something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record (a = "https://api-services.unknown.com/env/v6/permissions/check")
| parse a, "LD 'env/' LD:apiversion '/' LD:rest "&lt;/LI-CODE&gt;&lt;P&gt;See if helps&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2026 13:59:16 GMT</pubDate>
    <dc:creator>dannemca</dc:creator>
    <dc:date>2026-06-01T13:59:16Z</dc:date>
    <item>
      <title>Parsing URL</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300138#M3367</link>
      <description>&lt;P&gt;In DQL, I'm trying to parse an url to extract usefull data.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;A href="https://api-services.unknown.com/env/v6/permissions/check" target="_blank"&gt;https://api-services.unknown.com/env/v6/permissions/check&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I want to extract api version which is v6 in this case. Then, I want all the following, which would be&amp;nbsp;&lt;A href="https://api-services.unknown.com/env/v6/permissions/check" target="_blank"&gt;/permissions/check&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Both data would be in separate fields.&lt;/P&gt;&lt;P&gt;I have tried a lot things with parse but never managed to do it, whether it would be simple with a classic regexp.&lt;/P&gt;&lt;P&gt;I have read DPL Grammar documentation as well as DPL Lines and Strings, but I don't understand how to build the parse command for my need.&lt;/P&gt;&lt;P&gt;Right now, I am using this:&amp;nbsp;| fieldsAdd relativePath = substring(requestUrl, from: indexOf(requestUrl, "/", from: 8))&lt;/P&gt;&lt;P&gt;It isn't very good, but it is still better than the full url !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2026 13:18:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300138#M3367</guid>
      <dc:creator>apourbaix</dc:creator>
      <dc:date>2026-06-01T13:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing URL</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300145#M3368</link>
      <description>&lt;P&gt;With parsing command would be something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record (a = "https://api-services.unknown.com/env/v6/permissions/check")
| parse a, "LD 'env/' LD:apiversion '/' LD:rest "&lt;/LI-CODE&gt;&lt;P&gt;See if helps&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2026 13:59:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300145#M3368</guid>
      <dc:creator>dannemca</dc:creator>
      <dc:date>2026-06-01T13:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing URL</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300149#M3369</link>
      <description>&lt;P&gt;&lt;EM&gt;env&lt;/EM&gt; text is an example, it could be anything else.&lt;/P&gt;&lt;P&gt;I just tried try this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| parse requestUrl, "LD '/v' INT:versionNum '/' DATA:apiPath"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| fieldsAdd apiVersion = concat("v", toString(versionNum))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;| fieldsAdd apiEndpoint = concat("/", apiPath)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So far, it seems to work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2026 14:14:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-URL/m-p/300149#M3369</guid>
      <dc:creator>apourbaix</dc:creator>
      <dc:date>2026-06-01T14:14:53Z</dc:date>
    </item>
  </channel>
</rss>

