<?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 the negation operator in DPL in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Use-the-negation-operator-in-DPL/m-p/213781#M29</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can we use the negation operator in DPL? For instance, in the example below, the DataKey is always a string of 24 digits. It is essentially a timestamp followed by an identifier. I need to check log records when this DataKey is malformed or has a length of less than 24 characters.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Example log record:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;TaskQueue ... DataKey="202303281310073066696996"&amp;gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;/TaskQueue&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 11:23:27 GMT</pubDate>
    <dc:creator>educampver</dc:creator>
    <dc:date>2023-06-01T11:23:27Z</dc:date>
    <item>
      <title>Use the negation operator in DPL</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-the-negation-operator-in-DPL/m-p/213781#M29</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can we use the negation operator in DPL? For instance, in the example below, the DataKey is always a string of 24 digits. It is essentially a timestamp followed by an identifier. I need to check log records when this DataKey is malformed or has a length of less than 24 characters.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Example log record:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;&amp;lt;TaskQueue ... DataKey="202303281310073066696996"&amp;gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;/TaskQueue&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 11:23:27 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-the-negation-operator-in-DPL/m-p/213781#M29</guid>
      <dc:creator>educampver</dc:creator>
      <dc:date>2023-06-01T11:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use the negation operator in DPL</title>
      <link>https://community.dynatrace.com/t5/DQL/Use-the-negation-operator-in-DPL/m-p/213814#M36</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;please have a look at following query&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;data record(content="""&amp;lt;TaskQueue DataKey="202303281310073066696997"&amp;gt;&amp;lt;/TaskQueue&amp;gt;""")
| parse content, "DATA 'DataKey=' DQS:datakey"
| parse datakey, "TIMESTAMP('YYYYMMddHHmmssSSSSS'):date"
| parse datakey, "[0-9]{24}:numandlength"
| fieldsAdd malformed = if(isNull(datakey),true,else:false)
| fieldsAdd malformed = if(isNull(date),true,else:malformed)
| fieldsAdd malformed = if(isNull(numandlength),true,else:malformed )
| fieldsAdd malformed = if(Stringlength(datakey)!=24,true,else:malformed)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;some explanation&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;fist lets parse and extract the DataKey from the content. It is within a double-quoted string (therefore the DQS matcher)&lt;/LI&gt;
&lt;LI&gt;then let's parse the and extract DataKey to date and as well to a 24 digits long number&lt;/LI&gt;
&lt;LI&gt;afterward you check if any of those fields isNull. If yes, you set malformed to true&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 11:24:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Use-the-negation-operator-in-DPL/m-p/213814#M36</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-06-01T11:24:20Z</dc:date>
    </item>
  </channel>
</rss>

