<?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 Using CASE in DPL in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/Using-CASE-in-DPL/m-p/262365#M1498</link>
    <description>&lt;P&gt;When using DPL, namely in Logs Classic, we sometimes have to check and convert values.&lt;/P&gt;
&lt;P&gt;One great example is converting trap severity OID values into their corresponding loglevel's in Dynatrace.&lt;/P&gt;
&lt;P&gt;I have managed to make my first conversion, and it goes like this:&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;USING (INOUT "CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0":STRING ) | FIELDS_ADD( loglevel: (
case
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '1' then 'CRITICAL'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '2' then 'ERROR'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '3' then 'SEVERE'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '4' then 'WARN'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '5' then 'NOTICE'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '6' then 'INFO'
 else "NONE"
end
) )&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;While I still want to confirm if these loglevel's are the best match, I believe it is pretty self-explanatory.&lt;BR /&gt;BTW, the Cisco definition is:&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;1—Critical
2—Major
3—Minor
4—Warning
5—Clear
6—Info&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;Also, thanks for this great finding: &lt;A href="https://community.dynatrace.com/t5/Log-Analytics/Log-Processing-CASE-WHEN-THEN-ELSE-END-Documentation/m-p/258434" target="_blank" rel="noopener"&gt;https://community.dynatrace.com/t5/Log-Analytics/Log-Processing-CASE-WHEN-THEN-ELSE-END-Documentation/m-p/258434&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 10:51:06 GMT</pubDate>
    <dc:creator>AntonioSousa</dc:creator>
    <dc:date>2024-11-26T10:51:06Z</dc:date>
    <item>
      <title>Using CASE in DPL</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Using-CASE-in-DPL/m-p/262365#M1498</link>
      <description>&lt;P&gt;When using DPL, namely in Logs Classic, we sometimes have to check and convert values.&lt;/P&gt;
&lt;P&gt;One great example is converting trap severity OID values into their corresponding loglevel's in Dynatrace.&lt;/P&gt;
&lt;P&gt;I have managed to make my first conversion, and it goes like this:&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;USING (INOUT "CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0":STRING ) | FIELDS_ADD( loglevel: (
case
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '1' then 'CRITICAL'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '2' then 'ERROR'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '3' then 'SEVERE'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '4' then 'WARN'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '5' then 'NOTICE'
 when COLUMN("CISCO-SMI::ciscoMgmt.311.1.1.2.1.17.0") == '6' then 'INFO'
 else "NONE"
end
) )&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;While I still want to confirm if these loglevel's are the best match, I believe it is pretty self-explanatory.&lt;BR /&gt;BTW, the Cisco definition is:&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;1—Critical
2—Major
3—Minor
4—Warning
5—Clear
6—Info&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;Also, thanks for this great finding: &lt;A href="https://community.dynatrace.com/t5/Log-Analytics/Log-Processing-CASE-WHEN-THEN-ELSE-END-Documentation/m-p/258434" target="_blank" rel="noopener"&gt;https://community.dynatrace.com/t5/Log-Analytics/Log-Processing-CASE-WHEN-THEN-ELSE-END-Documentation/m-p/258434&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 10:51:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Using-CASE-in-DPL/m-p/262365#M1498</guid>
      <dc:creator>AntonioSousa</dc:creator>
      <dc:date>2024-11-26T10:51:06Z</dc:date>
    </item>
  </channel>
</rss>

