<?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 rules -- occurrence negation in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/231465#M415</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was OoO, thanks for the help but it unfortunately, I need to maintain the same structure and if I try to add&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;!&amp;lt;&amp;lt;('_') &lt;/STRONG&gt;&lt;/EM&gt;, it doesn't work.&lt;/P&gt;&lt;PRE&gt;| PARSE content, "
DATA{1,70000}?
(
('tenantId'|'tenant '|'tenant'|'TenantID'|'TenantId'|'tenantID'|'tenant_id'| 'tenant id'| 'tenant ID'|'Tenant ID'|'Tenant Id')
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? SPACE? [:|=]? SPACE?
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? ([a-zA-Z0-9-_{*}]{32}:tenantID)
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')?
)
"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;To provide you with more context, I need to skip if tenant starts with an underscore like --&amp;gt; _tenantID or _tenant or _tenant_Id&lt;/P&gt;&lt;P&gt;I hope this provides you with some clarification and thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Dec 2023 14:17:55 GMT</pubDate>
    <dc:creator>MartinBurgos</dc:creator>
    <dc:date>2023-12-11T14:17:55Z</dc:date>
    <item>
      <title>Parsing rules -- occurrence negation</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230006#M383</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;
&lt;P&gt;I need a helping hand with the following DQL parsing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| PARSE content, "
DATA{1,70000}?
(
('tenantId'|'tenant '|'tenant'|'TenantID'|'TenantId'|'tenantID'|'tenant_id'| 'tenant id'| 'tenant ID'|'Tenant ID'|'Tenant Id')
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? SPACE? [:|=]? SPACE?
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? ([a-zA-Z0-9-_{*}]{32}:tenantID)
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')?
)
"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to fetch all the occurrences I have as tenantId but I should skip&amp;nbsp;&lt;SPAN&gt;_tenant_&lt;/SPAN&gt;&amp;nbsp;and try to fetch&amp;nbsp; the next thing (i.e. negate underscores before tenant):&lt;/P&gt;
&lt;P&gt;This is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "Label": "messagingListener/processTrigger/processEvent",
  "caller": "generic_subscription.go:411",
  "level": "info",
  "message": "execution doesn't exist in db, proceeding to create it...",
  "periodType": "month",
  "resourceAction": "reload",
  "resourceType": "app",
  "scopemapping": "tenant",
  "spanID": "123412341234",
  "taskId": "123412341234",
  "taskdescription": "v1.app.reload.finished consumption context with tenant, resourceType, resourceAction scope",
  "taskname": "app_v1_reload_finished_with_tenant_resourceType_resourceAction_scope",
  "tenantId": "example-tfEokyGtBk7skpV3-example",
  "timestamp": "2023-11-27T10:00:25.032214397Z",
  "traceID": "km12mkl123mkl"
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The outcome of what I am trying to parse should be "example-tfEokyGtBk7skpV3-example".&lt;/P&gt;
&lt;P&gt;Please note that I can't parse the content as JSON because I'll be applying this to other&lt;/P&gt;
&lt;P&gt;Could you please help me with it?&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 09:01:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230006#M383</guid>
      <dc:creator>MartinBurgos</dc:creator>
      <dc:date>2023-11-28T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing rules -- occurrence negation</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230044#M384</link>
      <description>&lt;P&gt;If you're just trying to extract that portion of the payload you can do something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;parse fieldToParse, "DATA '\"tenantId\": \"' DATA:tenantId '\",' DATA"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Eric_Yu_0-1701115310176.png" style="width: 864px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/15853i6087DB6C1CB76E71/image-dimensions/864x353?v=v2" width="864" height="353" role="button" title="Eric_Yu_0-1701115310176.png" alt="Eric_Yu_0-1701115310176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Let me know if that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 20:02:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230044#M384</guid>
      <dc:creator>Eric_Yu</dc:creator>
      <dc:date>2023-11-27T20:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing rules -- occurrence negation</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230071#M385</link>
      <description>&lt;P&gt;Thanks Eric but unfortunately it does not apply to my real use case.&lt;/P&gt;&lt;P&gt;I have at least one hundred variations and I have found that whenever I have an underscore (e.g. _TenantID,_tenantID,_tenant, etc) it'll fetch the wrong string.&lt;/P&gt;&lt;P&gt;Would it be possible to negate the underscore? As the example below to skip _tenant_&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MartinBurgos_0-1701156664606.png" style="width: 735px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/15858i6A72FAAC4BFC4D91/image-dimensions/735x318?v=v2" width="735" height="318" role="button" title="MartinBurgos_0-1701156664606.png" alt="MartinBurgos_0-1701156664606.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 07:32:07 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230071#M385</guid>
      <dc:creator>MartinBurgos</dc:creator>
      <dc:date>2023-11-28T07:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing rules -- occurrence negation</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230086#M386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/67478"&gt;@MartinBurgos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes there is a &lt;A href="https://docs.dynatrace.com/docs/shortlink/dpl-modifiers#lookaround" target="_blank"&gt;negative look ahead modifier&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;does this DPL work for you&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$tenant = '"'('tenantId'|'tenant '|'tenant'|'TenantID'|'TenantID'|'tenant_id'|'tenant id'|'tenant ID'|'Tenant ID'|'Tenant Id') '"'!&amp;gt;&amp;gt;(','|'_'|EOL);
$tenantId = [a-zA-Z0-9-_{*}]{32};
DATA{1,15000} $tenant DATA? '"' $tenantId '"'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 09:31:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/230086#M386</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-11-28T09:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing rules -- occurrence negation</title>
      <link>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/231465#M415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was OoO, thanks for the help but it unfortunately, I need to maintain the same structure and if I try to add&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;!&amp;lt;&amp;lt;('_') &lt;/STRONG&gt;&lt;/EM&gt;, it doesn't work.&lt;/P&gt;&lt;PRE&gt;| PARSE content, "
DATA{1,70000}?
(
('tenantId'|'tenant '|'tenant'|'TenantID'|'TenantId'|'tenantID'|'tenant_id'| 'tenant id'| 'tenant ID'|'Tenant ID'|'Tenant Id')
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? SPACE? [:|=]? SPACE?
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')? ([a-zA-Z0-9-_{*}]{32}:tenantID)
('\\\\\\\\\\\\\"'|'\\\\\\\\\\\"'|'\\\\\\\\\"'|'\\\\\\\"'|'\\\\\"'|'\\\"'|'\"')?
)
"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;To provide you with more context, I need to skip if tenant starts with an underscore like --&amp;gt; _tenantID or _tenant or _tenant_Id&lt;/P&gt;&lt;P&gt;I hope this provides you with some clarification and thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 14:17:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Parsing-rules-occurrence-negation/m-p/231465#M415</guid>
      <dc:creator>MartinBurgos</dc:creator>
      <dc:date>2023-12-11T14:17:55Z</dc:date>
    </item>
  </channel>
</rss>

