<?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: Masking sensitive data | OTEL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291056#M2859</link>
    <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/81629"&gt;@luis_alcantara&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing that approach!&lt;BR /&gt;Your pattern should work when the sensitive value consistently starts with cpf- or cnpj-. However, if the log formats vary and these keys appear in different contexts (like "cpf": "12345678901" or "cnpj": "12345678000199"), then we&amp;nbsp; might need a more generic regex-based solution, like below (this is just an idea)&lt;BR /&gt;USING(INOUT content)&lt;BR /&gt;FIELDS_ADD(&lt;BR /&gt;content: REPLACE_PATTERN(&lt;BR /&gt;content,&lt;BR /&gt;"(cpf|cnpj)[^0-9]*[0-9]{11,14}",&lt;BR /&gt;"masked"&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 09 Dec 2025 00:06:56 GMT</pubDate>
    <dc:creator>sujit_k_singh</dc:creator>
    <dc:date>2025-12-09T00:06:56Z</dc:date>
    <item>
      <title>Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/290624#M2834</link>
      <description>&lt;P&gt;Guys, does anyone know of a way to mask sensitive data within the log content?&lt;BR /&gt;&lt;BR /&gt;The scenario is this: we have log ingestion, but the environment doesn't use a oneagent; it's all opentelemetry. There are several log format standards, so creating a rule for each one would be impractical. I'd like to understand if I can, for example, identify in the processing anything containing the key 'cpf' or 'cnpj', and if so, remove and/or mask it. All of this is within the log content.&lt;/P&gt;&lt;P&gt;I used the DPL below, but it only worked for one of the patterns. There are several others. So if there's a way to do something more generic, that would be great.&lt;BR /&gt;&lt;BR /&gt;Does anyone know of or have done something similar?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USING(INOUT content)
//| FIELDS_ADD(content: REPLACE_PATTERN(content, "'numberDocument' LD LD LD LD DATA:numberDocument'\\\"' ", "cpf-masked"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 23:01:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/290624#M2834</guid>
      <dc:creator>RPbiaggio</dc:creator>
      <dc:date>2025-12-01T23:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291041#M2858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67564"&gt;@RPbiaggio&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I reviewed your question and I believe the following DPL pattern might work for you:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DATA &amp;lt;&amp;lt;('cpf-'|'cnpj-') ALNUM:numberDocumentToMask&lt;/LI-CODE&gt;&lt;P&gt;This pattern captures the alphanumeric values that come after "cpf-" or "cnpj-", which you can then mask with just "masked". As a result, you would get "cpf-masked" or "cnpj-masked". Please note that this only works if the value you want to mask starts with "cpf-" or "cnpj-".&lt;/P&gt;&lt;P&gt;I’m also attaching some images that show the pattern applied to a sample text for better clarity.&lt;/P&gt;&lt;P&gt;I’m not sure if this fully answers your question, but if you’d like to explore it further, feel free to reply to this message and we can look into it together.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Images:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_alcantara_0-1765223815012.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/31143i44DEA8D3ED386C76/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_alcantara_0-1765223815012.png" alt="luis_alcantara_0-1765223815012.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_alcantara_1-1765223876040.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/31144iBBF879F796ED4FCA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_alcantara_1-1765223876040.png" alt="luis_alcantara_1-1765223876040.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2025 19:58:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291041#M2858</guid>
      <dc:creator>luis_alcantara</dc:creator>
      <dc:date>2025-12-08T19:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291056#M2859</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/81629"&gt;@luis_alcantara&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing that approach!&lt;BR /&gt;Your pattern should work when the sensitive value consistently starts with cpf- or cnpj-. However, if the log formats vary and these keys appear in different contexts (like "cpf": "12345678901" or "cnpj": "12345678000199"), then we&amp;nbsp; might need a more generic regex-based solution, like below (this is just an idea)&lt;BR /&gt;USING(INOUT content)&lt;BR /&gt;FIELDS_ADD(&lt;BR /&gt;content: REPLACE_PATTERN(&lt;BR /&gt;content,&lt;BR /&gt;"(cpf|cnpj)[^0-9]*[0-9]{11,14}",&lt;BR /&gt;"masked"&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 00:06:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291056#M2859</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2025-12-09T00:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291057#M2860</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67382"&gt;@sujit_k_singh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your contribution, and you’re absolutely right.&lt;/P&gt;&lt;P&gt;I just realized that the current approach is a bit limited because it only works with numbers and a specific number of characters. As a complement to your idea, I believe a more flexible version could be the following, where it allows alphanumeric characters of any length and still works even if there is a "-" or ":" after "cpf" or "cnpj":&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USING(INOUT content)
//| FIELDS_ADD(content: REPLACE_PATTERN(content, "DATA &amp;lt;&amp;lt;('cnpj'|'cpf')[^0-9A-Za-z]*[0-9A-Za-z]+:dataToMask", "masked"))&lt;/LI-CODE&gt;&lt;P&gt;If you’d like me to explain this in more detail, I’d be happy to do so.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 00:38:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291057#M2860</guid>
      <dc:creator>luis_alcantara</dc:creator>
      <dc:date>2025-12-09T00:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291063#M2861</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/81629"&gt;@luis_alcantara&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This approach definitely broadens the scope of masking and makes it more flexible. Thanks a lot for extending the solution and adding more coverage to it!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 03:24:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291063#M2861</guid>
      <dc:creator>sujit_k_singh</dc:creator>
      <dc:date>2025-12-09T03:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Masking sensitive data | OTEL</title>
      <link>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291115#M2863</link>
      <description>&lt;P&gt;Guys, thanks for the help.&lt;/P&gt;&lt;P&gt;The rule that worked for us was the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USING(INOUT content)
| FIELDS_ADD(content: REPLACE_PATTERN(content, "(DATA 'cpf' DATA):p1 LONG:cpf", "${p1}\"sensitive-data-masked${p2}\""))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case, I need to insert additional lines for each parameter, such as number, CPF, CNPJ, client_number, etc...&lt;/P&gt;&lt;P&gt;I'm asking the proprietary teams to adjust this at the source; it's easier that way due to the number of different possibilities and parameters.&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 11:50:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Masking-sensitive-data-OTEL/m-p/291115#M2863</guid>
      <dc:creator>RPbiaggio</dc:creator>
      <dc:date>2025-12-09T11:50:09Z</dc:date>
    </item>
  </channel>
</rss>

