Help querying data in Analytics GraphQL API
Hi! I'm setting up Zabbix to monitor given subdomains in Cloudflare by making API calls to get analytics data from the fields listed below for given subdomains in the zone -
requests
bytes
cachedBytes
threats
pageViews
visits
The first 5 datasets can be queried from the httpRequests1hGroups
(or 1m or 1d) group and the visits
dataset can be queried from httpRequestsAdaptiveGroups
.
The issue I'm having is that there doesn't seem to be a supported filter object for 'subdomains' in httpRequests1hGroups
even though httpRequestsAdaptiveGroups
supports the applicable filter object, clientRequestHTTPHost
.
I would appreciate any insight into how I can filter httpRequestsGroups
data in a similar way so that I can get the data for each subdomain (or host). I see this can be done in Web Analytics dashboard but making calls to the API seems an easier route especially given that Zabbix already has a template that makes these calls though it doesn't filter the data by subdomain.
Please and Thank you!!!3 Replies
Perhaps I'm not on the right track with this, if you have a better idea of how to approach this, please share
the httpRequest1hGroups/non-adaptive groups are mainly used for the free dashboard analytics, so naturally limited in the sense that you can't query by many dimensions with them.
Why not use
httpRequestsAdaptiveGroups
for all that data?
You should be able to get everything although perhaps not as easily, for example you can filter by cacheStatus to get cachedBytes. I believe threats is just requests mitigated/blocked which you can get via SecurityAction, pageVisits is just requests for html content, -- edgeResponseContentTypeName
(This is what the dashboard does to show Web Traffic Analytics, Cache Analytics, and Security Analytics)Thanks, I'll try that