# How to do log file analysis for AI crawlers

> Log file analysis for AI crawlers: find GPTBot, ClaudeBot and other bots in access logs, verify their IPs, and count requests by bot, path and status.

Canonical: https://promptlyfound.com/crawlers/log-file-analysis
Updated: 2026-11-20

## Short answer

Log file analysis for AI crawlers means searching your server or CDN access logs for the user agent tokens that AI operators publish, such as GPTBot and ClaudeBot. Treat a user agent match as **a claim until the IP address passes the operator's check**. Then count the verified requests by bot, path, status code and day, and compare them with your robots.txt rules.

## Key findings

- The Combined Log Format records the client IP address, time, request line, status code, response size, Referer header and User-Agent header of each request. nginx uses a predefined combined format when no format is named. [1]
- Google warns that the HTTP user agent string can be spoofed, and Common Crawl says other crawlers falsely identify themselves as CCBot. [4]
- If robots.txt returns a 5xx status code, a crawler that follows RFC 9309 must assume that the whole site is disallowed. A 4xx code lets it access any resource. [9]
- In Cloudflare's HTTP request logs, an OriginResponseStatus of 0 means the response came from Cloudflare's edge, and an empty EdgeServerIP means no request was made to the origin. [13]
- Google-Extended sends no requests under its own user agent, and Applebot-Extended does not crawl, so neither token appears in access logs. [4]

Access logs are your only first-party record of which AI crawlers fetch your pages and what they get back, so they are the evidence behind any decision to allow or block a bot. Log file analysis for AI crawlers means reading your web server or CDN access logs. The logs show which AI bots request your pages, which pages they fetch, how often, and which responses they get. Standard command-line tools such as `awk`, `sort` and `uniq` are enough for the work. Logs are one step of [an AI crawlability audit](https://promptlyfound.com/crawlers/ai-crawlability-audit), which also checks robots.txt, CDN rules, the raw HTML and sitemaps.

## What an access log records

A standard access log already holds every field a crawler audit needs. [Apache's documentation on log files](https://httpd.apache.org/docs/current/logs.html) defines the Combined Log Format. Each line holds the client IP address, the time, the request line, the status code, the response size, the Referer header and the User-Agent header:[1]

```
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"
```

nginx writes the same fields. [The nginx log module documentation](https://nginx.org/en/docs/http/ngx_http_log_module.html) says the server uses its predefined combined format when an access_log directive names no format. nginx can also write compressed logs, which `zcat` reads.[2]

The IP address is the address that connected to the server. When a proxy sits between the client and the server, Apache notes, the log records the proxy's address.[1] A site behind a CDN therefore logs the CDN's addresses at the origin, and the CDN's own logs are the ones to read.

In the combined format, with `awk` splitting on spaces, field 1 is the IP address, field 4 starts with the date, field 7 is the path and field 9 is the status code. Splitting on the double quote character (`-F'"'`) puts the Referer in field 4 and the user agent in field 6.

## Match AI crawler user agents

A match on the bot's token finds it even after its operator changes the rest of the user agent string. Each AI operator publishes the token that its crawler sends in the User-Agent header. The [crawler directory](https://promptlyfound.com/crawlers) lists them with a profile for each bot, such as [GPTBot](https://promptlyfound.com/crawlers/gptbot) and [ClaudeBot](https://promptlyfound.com/crawlers/claudebot). [The directory as JSON](https://promptlyfound.com/crawlers.json) gives the same data for scripts.

Match on the token alone and ignore case. [OpenAI's crawler overview](https://developers.openai.com/api/docs/bots) says the version numbers in its example strings may change. It may also add a `robots.txt` marker to the GPTBot and OAI-SearchBot strings when they fetch robots.txt.[3] [Google's list of common crawlers](https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers) tells site owners to use wildcards for the Chrome version in its user agents.[4] [Meta's web crawler page](https://developers.facebook.com/docs/sharing/webmasters/web-crawlers) writes its user agents in lower case, for example `meta-externalagent/1.1`.[5]

This command counts requests per bot. It counts each line once, even when the token appears twice in one string (GPTBot's string contains both `GPTBot/1.4` and `openai.com/gptbot`):

```
BOTS='gptbot|oai-searchbot|chatgpt-user|claudebot|claude-searchbot|claude-user|perplexitybot|perplexity-user|meta-externalagent|meta-webindexer|meta-externalfetcher|meta-externalads|bytespider|amazonbot|amzn-searchbot|amzn-user|ccbot|duckassistbot|applebot|bingbot|googlebot'

awk -F'"' -v bots="$BOTS" '{ua = tolower($6); if (match(ua, bots)) print substr(ua, RSTART, RLENGTH)}' access.log \
  | sort | uniq -c | sort -rn
```

For compressed files, replace `access.log` with `<(zcat access.log.*.gz)` in Bash.

Two tokens never appear in logs. Google-Extended has no user agent string of its own, because Google crawls with its existing user agents and reads the token as a control.[4] [Apple's About Applebot page](https://support.apple.com/en-us/119829) says Applebot-Extended does not crawl webpages and only decides how Apple uses data that Applebot crawls.[6] For those two operators, count Google's crawlers and Applebot.

## Verify before you count

Count a request as GPTBot or ClaudeBot only after its IP address passes the operator's check, because any client can send those names. A user agent is text that the client sends about itself. Google's crawler list warns that the string can be spoofed.[4] [Common Crawl's CCBot page](https://commoncrawl.org/ccbot) says other crawlers falsely identify themselves as CCBot.[7]

List the addresses that sent one bot's user agent, with the number of requests from each:

```
awk -F'"' 'tolower($6) ~ /claudebot/' access.log | awk '{print $1}' | sort | uniq -c | sort -rn
```

Check each address against the operator's published IP list, or with a reverse DNS lookup where the operator documents one. [How to verify AI crawlers](https://promptlyfound.com/crawlers/verify-ai-crawlers) gives the method and the list URL for each operator, and a script that tests an address against a JSON list. Report verified and unverified requests as separate counts, so spoofed traffic does not inflate a bot's numbers. The [log analyzer](https://promptlyfound.com/tools/log-analyzer) matches the tokens in a log file and checks each address against the operator's IP ranges.

## Requests by path, status and day

Counts by path, status and day show whether bots reach the pages you care about and whether your server turns them away. The most requested paths for one bot:

```
awk -F'"' 'tolower($6) ~ /gptbot/' access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
```

The status codes that bot received:

```
awk -F'"' 'tolower($6) ~ /gptbot/' access.log | awk '{print $9}' | sort | uniq -c | sort -rn
```

Requests per day, in the order the log was written:

```
awk -F'"' 'tolower($6) ~ /gptbot/' access.log | awk '{print substr($4, 2, 11)}' | uniq -c
```

When crawl volume from Google drops, look for 429 and 5xx responses first. [Google's page on HTTP status codes](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) says its crawlers slow down when a site returns 429 or 5xx codes. It also says 4xx codes other than 429 do not change the crawl rate, so 401 and 403 should not be used to limit crawling.[8] OpenAI's crawler overview does not say how its crawlers react to these codes.[3]

## robots.txt requests

A bot that never requests robots.txt is not reading your rules. A crawler that follows robots.txt requests the file before it crawls, and this command lists the robots.txt requests by bot and status code:

```
awk -F'"' -v bots="$BOTS" '$2 ~ /robots\.txt/ {ua = tolower($6); split($3, s, " "); if (match(ua, bots)) print substr(ua, RSTART, RLENGTH), s[1]}' access.log \
  | sort | uniq -c
```

[RFC 9309, the Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309.html), sets what the status code means for a compliant crawler. If the file returns a 4xx code, the crawler may access any resource on the server. If it returns a 5xx code, the crawler must assume that the whole site is disallowed. The RFC also says crawlers should not use a cached copy for more than 24 hours.[9] [Amazon's crawler page](https://developer.amazon.com/amazonbot) says its crawlers may use a copy from the last 30 days.[10]

To see which rule in your file applies to a bot, paste the file into the [robots.txt checker](https://promptlyfound.com/tools/ai-crawler-checker). Some bots are documented to ignore robots.txt in some cases. OpenAI says robots.txt rules may not apply to ChatGPT-User.[3] [Perplexity's crawler page](https://docs.perplexity.ai/docs/resources/perplexity-crawlers) says Perplexity-User generally ignores them, because a user requested the fetch.[11] [How to allow or block AI bots in robots.txt](https://promptlyfound.com/crawlers/robots-txt-for-ai) lists the rules for each bot.

## Crawl frequency

Frequency shows whether a bot's load fits its job, and which bots you can ask to slow down. Crawl frequency is the number of requests from a bot per day or per hour, and how often it fetches the same URL again. Requests per hour:

```
awk -F'"' 'tolower($6) ~ /oai-searchbot/' access.log | awk '{print substr($4, 2, 14)}' | uniq -c
```

URLs that the bot fetched more than once:

```
awk -F'"' 'tolower($6) ~ /oai-searchbot/' access.log | awk '{print $7}' | sort | uniq -c | awk '$1 > 1' | sort -rn | head -20
```

Compare the numbers with each bot's job. [What is the difference between training bots and search bots?](https://promptlyfound.com/crawlers/training-vs-search-bots) describes the jobs. To slow a bot down, check what its operator supports. [Anthropic's Help Center article on crawling](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler) says it supports the non-standard Crawl-delay rule.[12] Amazon and Apple say their crawlers do not follow it.[10] [6]

## CDN logs

On a site behind a CDN, origin logs undercount bot traffic. Requests that a CDN answers from its cache, or blocks at its edge, do not reach the origin server. [Cloudflare's HTTP request log fields](https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/zone/http_requests/) record whether the origin took part. An OriginResponseStatus of 0 means the response came from Cloudflare's edge, and an empty EdgeServerIP means no request was made to the origin.[13]

  <thead><tr><th scope="col">Fact</th><th scope="col">Combined Log Format</th><th scope="col">Cloudflare http_requests field</th></tr></thead>
  <tbody>
    <tr><th scope="row">Client IP address</th><td>%h (field 1)</td><td>ClientIP</td></tr>
    <tr><th scope="row">User agent</th><td>User-agent header (last quoted field)</td><td>ClientRequestUserAgent</td></tr>
    <tr><th scope="row">Path</th><td>Request line</td><td>ClientRequestPath</td></tr>
    <tr><th scope="row">Status code</th><td>%&gt;s</td><td>EdgeResponseStatus (to the client), OriginResponseStatus (from the origin)</td></tr>
    <tr><th scope="row">Cache result</th><td>Not recorded</td><td>CacheCacheStatus</td></tr>
    <tr><th scope="row">Bot classification</th><td>Not recorded</td><td>VerifiedBotCategory; BotScore for Bot Management customers only</td></tr>
  </tbody>

[Cloudflare's Logpush page](https://developers.cloudflare.com/logs/logpush/) lists Logpush on all plans. It says the datasets available depend on the products on the account.[14]

Cloudflare's AI Crawl Control dashboard summarizes the same traffic without an export. [Its traffic analysis page](https://developers.cloudflare.com/ai-crawl-control/features/analyze-ai-traffic/) lists requests by crawler and operator, a status code distribution, the most requested paths, and referrals from AI platforms on paid plans, with CSV downloads.[15] [Its robots.txt directives view](https://developers.cloudflare.com/ai-crawl-control/features/track-robots-txt/) lists crawlers that requested disallowed paths. Cloudflare says it compares past requests with the current file, so a newly added Disallow rule also flags requests made before the rule existed.[16] A crawler can therefore appear to have broken a rule that did not exist when it made the request. [How Cloudflare's AI bot settings work](https://promptlyfound.com/crawlers/cloudflare-ai-bot-settings) covers the block settings.

## What logs do not show

Logs show what a bot fetched, and they cannot tell you what happened to the page next. Access logs record the requests that reached the server. They do not show whether an operator used a page for training, added it to a search index or cited it in an answer.

Visits from people who click a link in an AI answer can carry the AI platform's domain in the Referer header. Cloudflare's analytics count referrals from domains such as chatgpt.com and perplexity.ai.[15] To count them in a combined log:

```
awk -F'"' 'tolower($4) ~ /chatgpt\.com|perplexity\.ai/ {print $4}' access.log | sort | uniq -c | sort -rn
```

[How to track AI traffic in GA4](https://promptlyfound.com/measurement/track-ai-traffic-in-ga4) covers referral traffic in analytics. AI agents that run inside a person's own browser send requests from an ordinary browser session, so their visits do not carry a bot token. [How AI browser agents access websites](https://promptlyfound.com/crawlers/ai-agents) explains the difference.

## Sources

1. Log Files. Apache HTTP Server Project. https://httpd.apache.org/docs/current/logs.html
2. Module ngx_http_log_module. nginx. https://nginx.org/en/docs/http/ngx_http_log_module.html
3. Overview of OpenAI Crawlers. OpenAI. https://developers.openai.com/api/docs/bots
4. List of Google's common crawlers. Google for Developers, 2026-10-30. https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers
5. Meta Web Crawlers. Meta for Developers. https://developers.facebook.com/docs/sharing/webmasters/web-crawlers
6. About Applebot. Apple Support. https://support.apple.com/en-us/119829
7. CCBot. Common Crawl. https://commoncrawl.org/ccbot
8. How HTTP status codes affect Google's crawlers. Google for Developers, 2026-02-04. https://developers.google.com/crawling/docs/troubleshooting/http-status-codes
9. RFC 9309: Robots Exclusion Protocol. IETF, 2022-09-01. https://www.rfc-editor.org/rfc/rfc9309.html
10. Amazon Web Search crawlers. Amazon Developer, 2026-10-26. https://developer.amazon.com/amazonbot
11. Perplexity Crawlers. Perplexity. https://docs.perplexity.ai/docs/resources/perplexity-crawlers
12. Does Anthropic crawl data from the web, and how can site owners block the crawler?. Anthropic Help Center. https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler
13. HTTP Requests (Logpush dataset fields). Cloudflare Docs. https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/zone/http_requests/
14. Logpush. Cloudflare Docs. https://developers.cloudflare.com/logs/logpush/
15. Analyze AI traffic. Cloudflare Docs. https://developers.cloudflare.com/ai-crawl-control/features/analyze-ai-traffic/
16. Directives (track robots.txt). Cloudflare Docs. https://developers.cloudflare.com/ai-crawl-control/features/track-robots-txt/

---

This is a plain-text copy of https://promptlyfound.com/crawlers/log-file-analysis from Promptly Found. The web page is the canonical version and includes the charts.
