<?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 Pro tip: Configure Cloudflare Logpush to Dynatrace in Dynatrace tips</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-tip-Configure-Cloudflare-Logpush-to-Dynatrace/m-p/236752#M1154</link>
    <description>&lt;P&gt;If you have a Cloudflare Enterprise plan, you can push logs from Cloudflare directly into Dynatrace.&lt;/P&gt;&lt;P&gt;To do that, you need the following data:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$ZONE_TAG&lt;BR /&gt;An hexadecimal identifier available from Cloudflare.&lt;/LI&gt;&lt;LI&gt;&amp;lt;ENV-ID&amp;gt;&lt;BR /&gt;Your Dynatrace tenant id&lt;/LI&gt;&lt;LI&gt;&amp;lt;TOKEN&amp;gt;&lt;BR /&gt;An API token with the API v2 scope "Ingest logs"&lt;/LI&gt;&lt;LI&gt;&amp;lt;EMAIL&amp;gt;&lt;BR /&gt;Your Cloudflare email account&lt;/LI&gt;&lt;LI&gt;&amp;lt;API_KEY&amp;gt;&lt;BR /&gt;An API KEY from Cloudflare.&lt;/LI&gt;&lt;LI&gt;&amp;lt;BASIC AUTHORIZATION&amp;gt;&lt;BR /&gt;An Authorization key from Cloudflare&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To enable the Job that initiates the Logpush from the Cloudflare side, you should then execute:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ curl -s https://api.cloudflare.com/client/v4/zones/$ZONE_TAG/logpush/jobs -X POST -d '
{
  "name": "dynatrace",
  "logpull_options": "fields=ClientIP,EdgeStartTimestamp,ClientRequestHost,ClientRequestMethod,ClientRequestPath&amp;amp;timestamps=rfc3339",
  "destination_conf": "https://&amp;lt;ENV-ID&amp;gt;.live.dynatrace.com/api/v2/logs/ingest?header_Authorization=Api-Token%20&amp;lt;TOKEN&amp;gt;&amp;amp;header_accept=application/json&amp;amp;header_content-type=application/json",
  "dataset": "http_requests",
  "enabled": true,
  "output_options": { "output_type": "ndjson", "batch_prefix": "[", "batch_suffix": "]", "record_delimiter": ","}
}' \
-H "X-Auth-Email: &amp;lt;EMAIL&amp;gt;" \
-H "X-Auth-Key: &amp;lt;API_KEY&amp;gt;" \
-H "Authorization: Bearer &amp;lt;BASIC AUTHORIZATION&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main trick, not explained in the Cloudflare documentation, is that Cloudflare, by default, seems to send the ndjson as text/plain. On the Dynatrace side, this is interpreted as a single log line, instead of being considered as JSON data. That's why in the above example, there is an additional header field passed as "header_content-type=application/json", so that Cloudflare sends an appropriate Content-type header to Dynatrace.&lt;/P&gt;&lt;P&gt;After the configuration above, you should start seeing your Cloudflare logs flowing into Dynatrace &lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@6EDF483EF947B43E16DF999BED8ABCC0/images/emoticons/dynaspin.gif" alt=":dynaspin:" title=":dynaspin:" /&gt;&lt;/P&gt;&lt;P&gt;Other information can be configured to be pushed to Dynatrace.&amp;nbsp; For more information on the Cloudflare side, check the &lt;A href="https://developers.cloudflare.com/logs/about/" target="_self"&gt;Cloudflare Docs&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 20:56:06 GMT</pubDate>
    <dc:creator>AntonioSousa</dc:creator>
    <dc:date>2024-02-09T20:56:06Z</dc:date>
    <item>
      <title>Pro tip: Configure Cloudflare Logpush to Dynatrace</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-tip-Configure-Cloudflare-Logpush-to-Dynatrace/m-p/236752#M1154</link>
      <description>&lt;P&gt;If you have a Cloudflare Enterprise plan, you can push logs from Cloudflare directly into Dynatrace.&lt;/P&gt;&lt;P&gt;To do that, you need the following data:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;$ZONE_TAG&lt;BR /&gt;An hexadecimal identifier available from Cloudflare.&lt;/LI&gt;&lt;LI&gt;&amp;lt;ENV-ID&amp;gt;&lt;BR /&gt;Your Dynatrace tenant id&lt;/LI&gt;&lt;LI&gt;&amp;lt;TOKEN&amp;gt;&lt;BR /&gt;An API token with the API v2 scope "Ingest logs"&lt;/LI&gt;&lt;LI&gt;&amp;lt;EMAIL&amp;gt;&lt;BR /&gt;Your Cloudflare email account&lt;/LI&gt;&lt;LI&gt;&amp;lt;API_KEY&amp;gt;&lt;BR /&gt;An API KEY from Cloudflare.&lt;/LI&gt;&lt;LI&gt;&amp;lt;BASIC AUTHORIZATION&amp;gt;&lt;BR /&gt;An Authorization key from Cloudflare&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To enable the Job that initiates the Logpush from the Cloudflare side, you should then execute:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ curl -s https://api.cloudflare.com/client/v4/zones/$ZONE_TAG/logpush/jobs -X POST -d '
{
  "name": "dynatrace",
  "logpull_options": "fields=ClientIP,EdgeStartTimestamp,ClientRequestHost,ClientRequestMethod,ClientRequestPath&amp;amp;timestamps=rfc3339",
  "destination_conf": "https://&amp;lt;ENV-ID&amp;gt;.live.dynatrace.com/api/v2/logs/ingest?header_Authorization=Api-Token%20&amp;lt;TOKEN&amp;gt;&amp;amp;header_accept=application/json&amp;amp;header_content-type=application/json",
  "dataset": "http_requests",
  "enabled": true,
  "output_options": { "output_type": "ndjson", "batch_prefix": "[", "batch_suffix": "]", "record_delimiter": ","}
}' \
-H "X-Auth-Email: &amp;lt;EMAIL&amp;gt;" \
-H "X-Auth-Key: &amp;lt;API_KEY&amp;gt;" \
-H "Authorization: Bearer &amp;lt;BASIC AUTHORIZATION&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main trick, not explained in the Cloudflare documentation, is that Cloudflare, by default, seems to send the ndjson as text/plain. On the Dynatrace side, this is interpreted as a single log line, instead of being considered as JSON data. That's why in the above example, there is an additional header field passed as "header_content-type=application/json", so that Cloudflare sends an appropriate Content-type header to Dynatrace.&lt;/P&gt;&lt;P&gt;After the configuration above, you should start seeing your Cloudflare logs flowing into Dynatrace &lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@6EDF483EF947B43E16DF999BED8ABCC0/images/emoticons/dynaspin.gif" alt=":dynaspin:" title=":dynaspin:" /&gt;&lt;/P&gt;&lt;P&gt;Other information can be configured to be pushed to Dynatrace.&amp;nbsp; For more information on the Cloudflare side, check the &lt;A href="https://developers.cloudflare.com/logs/about/" target="_self"&gt;Cloudflare Docs&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 20:56:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-tips/Pro-tip-Configure-Cloudflare-Logpush-to-Dynatrace/m-p/236752#M1154</guid>
      <dc:creator>AntonioSousa</dc:creator>
      <dc:date>2024-02-09T20:56:06Z</dc:date>
    </item>
  </channel>
</rss>

