Hi
I’d like to fetch the URL with path details that are not getting cached at Cloudflare level. The Percent Cached showing 0.20%. So how I can check it on dashboard, then how I can download the related logs from cloudflare.
I tried below commands, but didn’t got worked.
curl -X POST 'https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/logpush/edge/jobs'
-H ‘Authorization: ’
-H ‘X-Auth-Email: ’
-H ‘Content-Type: application/json’
-d ‘{
“fields”: “ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID”,
“sample”: 1,
“filter”: “”,
“kind”: “instant-logs”
}’ | jq .
given below result
“errors”: [
{
“code”: 1004,
“message”: “creating a new instant logs job is not allowed: exceeded max jobs allowed”
other one tried
curl -s
-H “X-Auth-Email: ”
-H “Authorization: <API_KEY>”
"https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/logs/received?start=2017-07-18T22:00:00Z&end=2017-07-18T22:01:00Z&count=1&fields=ClientIP,ClientRequestHost,ClientRequestMethod,ClientRequestURI,EdgeEndTimestamp,EdgeResponseBytes,EdgeResponseStatus,EdgeStartTimestamp,RayID"
Result:-
“errors”: [
{
“code”: 1010,
“message”: “auth.forbidden”
} “errors”: [
{
“code”: 1010,
“message”: “auth.forbidden”
}
and last one
curl -s
-H “X-Auth-Email: ”
-H “Authorization: <API_KEY>”
"https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/logs/received?start=2017-07-18T22:00:00Z&end=2017-07-18T22:01:00Z&count=1&fields=$(curl -s -H "X-Auth-Email: <EMAIL>" -H "Authorization: <API_KEY>"
"https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/logs/received/fields" | jq '. | to_entries[] | .key' -r | paste -sd "," -)"
Result was
{“success”:false,“errors”:[{“code”:10000,“message”:“Authentication error”}]}
Thanks