I’m on the Pro plan so I’m only able to view the security events up to 24 hours ago. Does Cloudflare provide API for me to export the events programmatically?
cbrandt
September 18, 2023, 1:01pm
4
Hi,
You can use the GraphQL API to query firewall events.
Here’s a list of GraphQL API Firewall Events - available fields
To make a query: https://developers.cloudflare.com/analytics/graphql-api/tutorials/querying-firewall-events
Currently, each query may contain up to 30 fields.
AVAILABLE ON ALL PLANS:
# starts a comment, so it’s OK to copy and paste the lines here for testing on a GraphiQL/curl query
Request Info:
clientASNDescription # The ASN name
clientAsn # The ASN number
clientCountryName # country code [T1=Tor, XX=unknown]
clientIP # The …
There’s also a ready script to do so developed by @eva2000 that may make your life easier.
2 Likes