<?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 How to use regex with DQL? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-use-regex-with-DQL/m-p/262161#M1418</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'd like to build a complex regex in DQL. I can't use the same syntax as OneAgent's masking rule, so I tested the parse command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[0][1-9][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield1([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[1][0-2][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield2([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[0][1-9][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield3([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[1][0-2][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield4([:space:]|[:punct:])"
| fields myfield=coalesce(myfield1, myfield4, myfield3, myfield4), content, log.source, k8s.namespace.name
| filterOut isNull(myfield)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs
| parse content, "DATA ([:space:]|[:punct:])(([12][0-9]{2}[0][1-9][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[1][0-2][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[0][1-9][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[1][0-2][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield)([:space:]|[:punct:])"
| fields myfield, content, log.source, k8s.namespace.name
| filterOut isNull(myfield)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this costs "four DQL queries" (for each alternative) and this is not acceptable to the customer&amp;nbsp;because of the high volume ...&lt;BR /&gt;What's the best practice for complex regexes? Is there a roadmap for improving the use of regexes with DQL?&amp;nbsp;Or to harmonize the syntax used in the platform?&lt;/P&gt;
&lt;P&gt;Thanks for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2024 07:49:09 GMT</pubDate>
    <dc:creator>jegron</dc:creator>
    <dc:date>2024-11-13T07:49:09Z</dc:date>
    <item>
      <title>How to use regex with DQL?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-use-regex-with-DQL/m-p/262161#M1418</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'd like to build a complex regex in DQL. I can't use the same syntax as OneAgent's masking rule, so I tested the parse command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[0][1-9][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield1([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[1][0-2][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield2([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[0][1-9][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield3([:space:]|[:punct:])"
| parse content, "DATA ([:space:]|[:punct:])([12][0-9]{2}[1][0-2][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield4([:space:]|[:punct:])"
| fields myfield=coalesce(myfield1, myfield4, myfield3, myfield4), content, log.source, k8s.namespace.name
| filterOut isNull(myfield)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch logs
| parse content, "DATA ([:space:]|[:punct:])(([12][0-9]{2}[0][1-9][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[1][0-2][0-9]{2}[0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[0][1-9][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield|([12][0-9]{2}[1][0-2][2][A-B][0-9]{3}[0-9]{3}[0-9]{2}):myfield)([:space:]|[:punct:])"
| fields myfield, content, log.source, k8s.namespace.name
| filterOut isNull(myfield)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this costs "four DQL queries" (for each alternative) and this is not acceptable to the customer&amp;nbsp;because of the high volume ...&lt;BR /&gt;What's the best practice for complex regexes? Is there a roadmap for improving the use of regexes with DQL?&amp;nbsp;Or to harmonize the syntax used in the platform?&lt;/P&gt;
&lt;P&gt;Thanks for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 07:49:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-use-regex-with-DQL/m-p/262161#M1418</guid>
      <dc:creator>jegron</dc:creator>
      <dc:date>2024-11-13T07:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use regex with DQL?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-use-regex-with-DQL/m-p/262312#M1432</link>
      <description>&lt;P&gt;Applying multiple parsing rules on same data does not increase query cost. It only depends in how much data you needs to access.&lt;BR /&gt;Of course heavy parsing parsing will affect query performance, but use of regex will not improve anything here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 12:51:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-use-regex-with-DQL/m-p/262312#M1432</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2024-11-13T12:51:04Z</dc:date>
    </item>
  </channel>
</rss>

