Retrieve number of firewall rule / firewall activity hits via API

Hi there,

I’d like to access the “activity over last 24 hours” property for a firewall rule via the API.
I know I can list individual events, but I would instead like the number of events for the rule.
Is there a good way to retrieve that? I’ve attached an image of the exact number I’m looking for from the dashboard for clarity.


That is a good suggestion… I will pass it along to the team, but I don’t believe we expose that data or the api endpoint which generates it externally. Today you could generate the same information by pulling firewall events via API and querying the data itself in your own system.

I was able to accomplish what I wanted using the GraphQL API, but I do still think that exposing this data via the REST API would be helpful!
@cscharff Here’s the query I’m using:
{ viewer { zones(filter: {zoneTag: "Zone Tag"}) { firewallEventsAdaptiveByTimeGroups(limit: 1, filter: {ruleId: "Rule ID", datetime_geq: "Start Date", action:"challenge", datetime_leq: "End Date"}) { dimensions { datetimeHour } count } } } }

1 Like