Would like to fetch url/path details which are not getting cached. Also want to download logs

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

What account type do you have?

Instant logs are only available to business and enterprise users, and logpull and logpush are enterprise only.

It is a Pro account.

Even early period logs will also work to me. Like 1 day or 2 days before.

On a free or pro account all that’s available is a log of security events.

Cloudflare processes 20-60 million requests per second. Even 1-2 days of logs for everyone isn’t practical.

[add]

See here for how the cache works and then you can use cache rules to adjust for your requirements…

So atleast then how I can fetch/search requests that needs to be cached?

The logs in your origin will, by definition, be requests not cached. Look at those and see what you can add to cache rules to make it happen.