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.
In short. 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.
On this page 11 sections
The evidence
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
1Apache HTTP Server ProjectApache HTTP Server 2.4 documentation and nginx log module documentation, checked Nov 20, 2026.Google warns that the HTTP user agent string can be spoofed, and Common Crawl says other crawlers falsely identify themselves as CCBot.4
4Google for DevelopersGoogle's list of common crawlers and Common Crawl's CCBot page, checked Nov 20, 2026.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
9IETFRFC 9309, sections 2.3.1.3 and 2.3.1.4.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
13Cloudflare DocsGoogle-Extended sends no requests under its own user agent, and Applebot-Extended does not crawl, so neither token appears in access logs.4
4Google for DevelopersGoogle's list of common crawlers and Apple's About Applebot page.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, 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 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 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 lists them with a profile for each bot, such as GPTBot and ClaudeBot. The directory as JSON gives the same data for scripts.
Match on the token alone and ignore case. OpenAI's crawler overview 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 tells site owners to use wildcards for the Chrome version in its user agents.4 Meta's web crawler page 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 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 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 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 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 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, 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 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. 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 says Perplexity-User generally ignores them, because a user requested the fetch.11 How to allow or block AI bots in robots.txt 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? describes the jobs. To slow a bot down, check what its operator supports. Anthropic's Help Center article on crawling 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 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
| Fact | Combined Log Format | Cloudflare http_requests field |
|---|---|---|
| Client IP address | %h (field 1) | ClientIP |
| User agent | User-agent header (last quoted field) | ClientRequestUserAgent |
| Path | Request line | ClientRequestPath |
| Status code | %>s | EdgeResponseStatus (to the client), OriginResponseStatus (from the origin) |
| Cache result | Not recorded | CacheCacheStatus |
| Bot classification | Not recorded | VerifiedBotCategory; BotScore for Bot Management customers only |
Cloudflare's Logpush page 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 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 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 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 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 explains the difference.
Read next
Crawlers
How to allow or block AI bots in robots.txt
robots.txt rules to allow all crawlers, block AI training or block all AI bots, from RFC 9309 and the tokens that AI bot operators document.
Crawlers
How Cloudflare's AI bot settings work
Cloudflare sets AI bot policy by Search, Agent and Training. Since September 15, 2026, a Training block also stops Googlebot, Bingbot and Applebot.
Measurement
How to track ChatGPT and AI assistant traffic in GA4
Since May 13, 2026, GA4 puts visits from recognized AI assistants in an AI Assistant channel. A custom channel group lets you set the rules yourself.
Crawlers
How to run an AI crawlability audit
An AI crawlability audit checks whether AI crawlers can reach and read your pages: robots.txt, CDN rules, raw HTML, sitemaps, server logs and llms.txt.
Questions
Why do my origin logs show no AI crawlers?
If the site is behind a CDN, requests answered from the CDN's cache or blocked at its edge never reach the origin, and the origin may record the CDN's IP addresses. Check the CDN's logs. Also check that robots.txt does not return a 5xx code, which tells compliant crawlers to treat the whole site as disallowed.
Which AI bots may request paths that robots.txt disallows?
Bots that fetch a page because a person asked for it. OpenAI says robots.txt rules may not apply to ChatGPT-User. Perplexity says Perplexity-User generally ignores them. Meta says Meta-ExternalFetcher may bypass robots.txt, and Amazon says Amzn-User may not follow all directives.
Do Google-Extended and Applebot-Extended appear in logs?
No. Google-Extended has no user agent string of its own, and Applebot-Extended does not crawl. Both are robots.txt tokens that control how content fetched by Google's crawlers and by Applebot is used.
Notes
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
About this page
Researched and reviewed by Promptly Found. Reviewed Nov 20, 2026. Next review due Feb 2027.
Cite this page
Promptly Found. (2026, November 20). How to do log file analysis for AI crawlers https://promptlyfound.com/crawlers/log-file-analysis
Revisions 1
- First published.