<?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 Use DQL Search Command for Efficient Data Retrieval in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280201#M2237</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to use the &lt;A href="https://docs.dynatrace.com/docs/shortlink/filter-and-search-commands#search" target="_self"&gt;search&lt;/A&gt; command in DQL to &lt;STRONG&gt;mask&lt;/STRONG&gt; or &lt;STRONG&gt;obfuscate&lt;/STRONG&gt; certain information based on a pattern?&lt;/P&gt;
&lt;P&gt;For example, I'd like to search logs that contain a credit card number and then mask part of it (e.g., show only the last 4 digits). Is there any built-in function or workaround in DQL that allows this kind of pattern-based masking or transformation?&lt;/P&gt;
&lt;P&gt;Any help or examples would be appreciated!&lt;/P&gt;</description>
    <pubDate>Thu, 18 Dec 2025 10:40:27 GMT</pubDate>
    <dc:creator>m_zol</dc:creator>
    <dc:date>2025-12-18T10:40:27Z</dc:date>
    <item>
      <title>Use DQL Search Command for Efficient Data Retrieval</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280201#M2237</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to use the &lt;A href="https://docs.dynatrace.com/docs/shortlink/filter-and-search-commands#search" target="_self"&gt;search&lt;/A&gt; command in DQL to &lt;STRONG&gt;mask&lt;/STRONG&gt; or &lt;STRONG&gt;obfuscate&lt;/STRONG&gt; certain information based on a pattern?&lt;/P&gt;
&lt;P&gt;For example, I'd like to search logs that contain a credit card number and then mask part of it (e.g., show only the last 4 digits). Is there any built-in function or workaround in DQL that allows this kind of pattern-based masking or transformation?&lt;/P&gt;
&lt;P&gt;Any help or examples would be appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 10:40:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280201#M2237</guid>
      <dc:creator>m_zol</dc:creator>
      <dc:date>2025-12-18T10:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: DQL search command</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280207#M2238</link>
      <description>&lt;P&gt;Why do you have credit card numbers stored&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Anyway, my take on the "Scenario".&lt;/P&gt;&lt;P&gt;Probably don't need the replace string and can just use substring from whatever position you need.&lt;/P&gt;&lt;P&gt;These should really be filtered on ingestion an ideally not in logs at all. You do you...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data json:"""[
  { "ccnumber": "1234 5678 9012 3456" },
  { "ccnumber": "2345 6789 0123 4567" },
  { "ccnumber": "3456 7890 1234 5678" },
  { "ccnumber": "4567 8901 2345 6789" },
  { "ccnumber": "5678 9012 3456 7890" },
  { "ccnumber": "6789 0123 4567 8901" },
  { "ccnumber": "7890 1234 5678 9012" },
  { "ccnumber": "8901 2345 6789 0123" },
  { "ccnumber": "9012 3456 7890 1234" },
  { "ccnumber": "0123 4567 8901 2345" }
]"""
| fieldsAdd replaceString = replaceString(ccnumber," ","")
| fieldsadd leng = stringLength(trim(replaceString))
| fieldsAdd last4 = substring(replaceString, from: (leng -4 ))
| fieldsAdd concat("**** **** **** ",last4 )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mullaneyb_0-1750908987060.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28681i0902A0C694EF47C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mullaneyb_0-1750908987060.png" alt="Mullaneyb_0-1750908987060.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;PS: I didn't realise you were in fact referencing&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/filter-and-search-commands#search" target="_blank" rel="noopener"&gt;https://docs.dynatrace.com/docs/shortlink/filter-and-search-commands#search&lt;/A&gt;&amp;nbsp;. I'm not familiar with this feature at all so unsure if anything I said helps&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 03:54:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280207#M2238</guid>
      <dc:creator>Mullaneyb</dc:creator>
      <dc:date>2025-06-26T03:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: DQL search command</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280208#M2239</link>
      <description>&lt;P&gt;there is a DPL example of CC masking at ingestion.&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/logs/methods-of-masking-sensitive-data" target="_blank"&gt;Methods of masking sensitive data — Dynatrace Docs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;the way search seems to work is check any value so in my example it would search "1234" anywhere in the card and if it hits show back all cc numbers that have "1234" otherwise you could just filter on the last4&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//| search "1234" // search all rows/columns
| fieldsAdd replaceString = replaceString(ccnumber," ","")
| fieldsadd leng = stringLength(trim(replaceString))
| fieldsAdd last4 = substring(replaceString, from: (leng -4 ))
| fieldsAdd hidden = concat("**** **** **** ",last4 )
//| filter matchesValue(last4, "1234") // only search last four
| fields hidden&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 04:01:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280208#M2239</guid>
      <dc:creator>Mullaneyb</dc:creator>
      <dc:date>2025-06-26T04:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: DQL search command</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280243#M2240</link>
      <description>&lt;P&gt;Thanks for the response!&lt;/P&gt;&lt;P&gt;Just to clarify — the credit card number was just an &lt;STRONG&gt;example&lt;/STRONG&gt;. The real concern involves sensitive data in general, like &lt;STRONG&gt;user IDs&lt;/STRONG&gt;, &lt;STRONG&gt;account numbers&lt;/STRONG&gt;, etc. Of course, the best practice is to &lt;STRONG&gt;avoid logging this kind of information altogether&lt;/STRONG&gt;, but unfortunately, that’s &lt;STRONG&gt;not our current reality&lt;/STRONG&gt;. We have a large volume of logs where such data may appear, and we're trying to find a way to &lt;STRONG&gt;proactively detect and mask it&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Regarding the examples shared so far: they’re helpful, but still not fully effective for our use case. The main challenge is that we &lt;STRONG&gt;don’t know the exact field names&lt;/STRONG&gt; where the sensitive information might appear. That’s why we’re using search to filter based on patterns like "cardNumber", "card number", "card", etc., to &lt;STRONG&gt;catch any record&lt;/STRONG&gt; that contains those terms in &lt;STRONG&gt;any field&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;What we need next is a way to use &lt;STRONG&gt;DPL&lt;/STRONG&gt; to &lt;STRONG&gt;scan for numeric patterns&lt;/STRONG&gt; (like potential card numbers or user IDs) within the matched records and then &lt;STRONG&gt;mask or obfuscate&lt;/STRONG&gt; them — regardless of where they appear. That’s proving to be a &lt;STRONG&gt;complex task&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Has anyone tried something similar or found an efficient workaround for this kind of scenario?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 11:21:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/280243#M2240</guid>
      <dc:creator>m_zol</dc:creator>
      <dc:date>2025-06-26T11:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: DQL search command</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/291785#M2922</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/62941"&gt;@m_zol&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN&gt;I just wanted to check in and see if you still need help with this. If so, I’d be happy to look into it for you!&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know what works best for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 10:39:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-DQL-Search-Command-for-Efficient-Data-Retrieval/m-p/291785#M2922</guid>
      <dc:creator>IzabelaRokita</dc:creator>
      <dc:date>2025-12-18T10:39:56Z</dc:date>
    </item>
  </channel>
</rss>

