Listing Firewall Events..
I am listing Cloudflare firewall events.
However, instead of writing which rule is in the source section, it says firewallCustom.
How can i fix this...
My code: https://discord.com/channels/595317990191398933/1114130327351332964
Source eq: Http 1.0 Block Rule...
20 Replies
source is just the product. You want ruleId or rulesetId I believe
Yeah, it could be ruleid, it doesn't matter.
what do you mean? Are you saying those fields don't contain the http 1.0 block rule id?
I want to know which rule the incident belongs to
Listing all events for Cloudflare custom rule
I would like to know which custom rule these listed events belong to
That's the ruleSetId property
Hmm so I can't use this feature in firewall events
that rule has a ID for itself (rulesetId), and an ID for each of the specific rules within it (ruleId)
and in events, the ruleId = that
you can filter by it as well
Ah ok does every custom rule have a ruleset id
err sorry I explained that a bit weirdly, every rule has a ruleId, the rulesetId is the ID for all custom rules in general
(you can filter by either, of course)
hmm It's too complicated. 😦
If you want to filter for a specific rule, just get the rule id, and filter by
ruleId
.
The ruleSetId
is just the same ID for all custom rules within your zone, as I understand ithttps://developers.cloudflare.com/analytics/graphql-api/tutorials/querying-magic-firewall-samples/
Isn't it like the use here
Querying Magic Firewall Samples with GraphQL · Cloudflare Analytics...
In this example, we are going to use the GraphQL Analytics API to query for Magic Firewall Samples over a specified time period.
looks like it, yep.
😘
If it's worth mentioning, that uses groups with sampling, i.e
firewallEventsAdaptiveGroups
, not firewallEventsAdaptive
, and firewallEventsAdaptiveGroups
seems to be Pro or higher
even without that exact query though, you can just add ruleId
to your list of fields in firewallEventsAdaptive
and do the grouping/counting yourself, up to a point
Yeah, I got it, thank you, mate. @chaika.me