Cloudflare

Requirements

  • Account ID

  • Account API Token

Navigation Steps

  1. Login to your Cloudflare account.

  2. Follow Cloudflare instructions to create an Account API Token:
    https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/

  3. Ensure the token has permission to read all resources. At the time of writing, Cloudflare provides a template for this:


  1. Take note of the Account ID the API token is created.

  2. Testing that you have the right permissions/token/account can be done by running the following curl command in a terminal:

    1. curl -X GET "https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/logs/audit?since=2025-03-01T00:00:00Z&before=2040-09-29T23:59:59Z" \ 
          -H "Accept: application/json" \
          -H "Authorization: Bearer YOUR_API_TOKEN"



Available on Data Gallery
No NiFi configuration required!

NiFi Provisioning

Processor

Version

CloudflareAudit

1.0 > 1.x

Pipeline Structure

graph TD
    CloudflareAudit -- "EVENTS" --> PutElasticCS
    CloudflareAudit -- "FILTERED" --> PutElasticCS
    CloudflareAudit -- "ALERTS" --> PutElasticCS-Alerts

Configuring CloudflareAudit processor

Processor Version 1.0

Property

Value

Api Token

Your API Token

Account ID

Your Account ID

Configuring PutElasticCS

Processor Version 1.0

Property

Value

Value

Elasticsearch ID attribute

es_id

es_id

Elasticsearch Default Index

cloudflare-${now():format('yyyy.MM.dd')}

alerts-${now():format('yyyy.MM.dd')}

Elasticsearch Username

No value set

No value set

Elasticsearch Index Flowfile Attribute

No value set

No value set

Proxy Port

No value set

No value set

Backup Directory

No value set

No value set

Proxy IP

No value set

No value set

Bulk Size

1000

1000

Elasticsearch Password

No value set

No value set

Multiple JSON per flowfile

FALSE

FALSE

Elasticsearch URL

http://localhost:9200

http://localhost:9200


You successfully configured the log source, please make sure to define the Index Patterns


tags:

  • Cloudflare Logs Setup

  • NiFi Cloudflare Setup