Cloudflare (Logpush)
Cloudflare Logpush sends Log Hero a record of every request that Cloudflare answers for your domain. This includes the requests that Cloudflare serves from cache, which never get to your origin server. You do not install code on your server. You create one API token in Cloudflare, and Log Hero creates the Logpush job for you.
Time: about 10 minutes · Access needed: Cloudflare account with access to the domain, Log Hero account
Before you start
Section titled “Before you start”Make sure that you have:
- A Cloudflare account that can create an API token for the domain.
- The domain added in Log Hero. If it is not, do the Quickstart first.
- Fewer than four Logpush jobs on the domain. Cloudflare permits four jobs per domain, and Log Hero adds one.
Cloudflare bills Logpush volume separately from your Log Hero plan.
1. Create a Cloudflare API token
Section titled “1. Create a Cloudflare API token”Log Hero uses this token once, to create the Logpush job. Log Hero does not store the token.
-
Choose Create Token and start a custom token.
-
Under Permissions, choose Add more and add these two permissions:
Scope Category Permission Zone Zone Read Zone Logs Edit -
Under Zone Resources, select the domain that you want to connect.
-
Choose Continue to summary, then Create Token.
-
Copy the token. Cloudflare shows it only once.
The token does not need Analytics → Read. Do not add more permissions than the two in the table.
2. Connect the domain in Log Hero
Section titled “2. Connect the domain in Log Hero”- In your Keyword Hero account, open Log Hero → Bot Activity for the domain.
- Choose Log Hero token. The setup page opens.
- Under How to start?, choose Cloudflare.
- Paste the token into the Cloudflare API token field.
- Choose Connect.
- If the token gives access to more than one domain, select the domain from the list.
- Choose Confirm.
Log Hero shows Connected — your data will start showing up in Log Hero within
about an hour. At this point Log Hero has created a Logpush job named
loghero on your domain in Cloudflare.
3. Make sure that hits arrive
Section titled “3. Make sure that hits arrive”- In the Cloudflare dashboard, go to Analytics & Logs → Logpush.
- Make sure that the job
logherois listed and that its status is not Error. - Wait up to one hour. Logpush collects records in batches before it sends them.
- Open Log Hero → Bot Activity. Make sure that the status line reads Log Hero is receiving bot traffic for this domain.
- Make sure that Bot hits is not zero.
When Cloudflare creates the job, it sends Log Hero a small test message. This message contains no request data and does not appear as a hit.
You do not need to make traffic yourself. Bots arrive on their own, and on most sites the first bot request lands within the hour.
If the setup page shows an error
Section titled “If the setup page shows an error”| Message | Cause | What to do |
|---|---|---|
| We couldn’t validate this token. | The token is wrong or expired, or Cloudflare did not answer. | Paste the token again. If the error stays, create a new token. |
| This token is missing a required permission. | The token lacks Zone → Read or Logs → Edit. | Create a new token with the two permissions from step 1. |
| This domain already has the maximum number of Logpush jobs Cloudflare allows. | The domain has four Logpush jobs. | Remove one job in the Cloudflare dashboard. Then choose Confirm again. |
| This domain is already sending logs to Log Hero. | A loghero job exists on the domain. |
Do nothing. The domain is connected. |
| Something went wrong connecting to Cloudflare. | A temporary error. | Try again. |
What the connector sends
Section titled “What the connector sends”Log Hero creates the job on the Cloudflare http_requests dataset with a fixed
list of ten fields. You cannot change this list in Log Hero. If you add fields
to the job in Cloudflare, Log Hero ignores them.
ClientIPClientRequestHostClientRequestMethodClientRequestRefererClientRequestSchemeClientRequestURIClientRequestUserAgentEdgeResponseStatusEdgeStartTimestampEdgeTimeToFirstByteMsThree facts about these fields matter for your reports:
ClientIPis required. When the record arrives, Log Hero hashes the address and does not store the raw address. The hash identifies the visitor. A record withoutClientIPis dropped.- Timing is measured at the edge.
EdgeTimeToFirstByteMsis the time from Cloudflare’s edge to the first byte of the response. The origin integrations measure the time inside your server, so the two values are not comparable. - Sampling is off. Log Hero does not turn on sampling when it creates the job, and the bot counts depend on that. Do not turn on sampling for the job in Cloudflare.
What Logpush does not send
Section titled “What Logpush does not send”- Requests that Cloudflare never sees. Traffic that goes to your origin directly is invisible here. If your DNS has a bare origin hostname, bots will find it.
- Requests that Cloudflare stops before it logs them. A WAF rule, a rate limit, or Bot Fight Mode stops the request before Logpush records it. If your Bot Activity report shows far fewer AI crawlers than you expect, examine those rules first.
Disconnect the domain
Section titled “Disconnect the domain”Log Hero cannot delete the job for you.
- In the Cloudflare dashboard, go to Analytics & Logs → Logpush.
- Delete the job named
loghero.
Data stops within the hour. If you connect the domain again later, Log Hero creates a new job.
If it does not work
Section titled “If it does not work”Work through No data arriving. Two causes are specific to Cloudflare. The first is a Logpush job in the Error state, which Cloudflare shows in the job list. The second is a WAF rule that stops the crawler before Cloudflare logs it.
