{"slug": "which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena", "title": "Which AI Crawlers Visit Your Site? Find Out with CloudFront Logs and Athena", "summary": "A new AWS builder guide shows how to use CloudFront access logs and Amazon Athena queries to determine whether AI crawlers such as OAI-SearchBot, ChatGPT-User, GPTBot and PerplexityBot reach a site, which pages they fetch, and which requests fail with 403 or 404 errors. The guide instructs operators to enable CloudFront standard logging (v2), which can deliver to Amazon S3, CloudWatch Logs or Data Firehose in JSON, W3C or Parquet formats, and notes that logging changes can take up to 12 hours to take effect and that CloudFront never deletes log files, so an S3 lifecycle rule is needed. It follows an earlier article on the three layers — robots.txt, AWS WAF rules and page rendering — that decide whether AI crawlers can reach a site on Amazon S3 and CloudFront.", "body_md": "# Which AI Crawlers Visit Your Site? Find Out with CloudFront Logs and Athena\n\nUse CloudFront access logs and a few Amazon Athena queries to see whether OAI-SearchBot, PerplexityBot and other crawlers reach your site, which pages they fetch, which requests fail with 403 or 404, and whether AI answers send you visitors.\n\nSEO, Technical SEO & AI Search Optimization\n\nIn an earlier article,  \n\n[Is Your AWS Setup Blocking AI Search Crawlers?](https://builder.aws.com/content/37s1LBw7NKxCpxcsJKQwWM1qTjV/is-your-aws-setup-blocking-ai-search-crawlers), we covered the three layers that decide whether AI crawlers*can*reach a site on Amazon S3 and CloudFront: robots.txt, AWS WAF rules and page rendering.\nThis article answers the next question: \n\n**are they actually visiting, what are they fetching, and are any of those requests failing?** You can answer all three with data you may already have: CloudFront access logs and a few Amazon Athena queries.\n## 1. Turn on CloudFront standard logging\n\nIf logging isn't on yet, enable it on your distribution. CloudFront now offers  \n\n[standard logging (v2)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/standard-logging.html), which can deliver to Amazon S3, CloudWatch Logs or Data Firehose, in formats including JSON, W3C and Parquet. The original tab-delimited logging (now called \"legacy\") still works, and you can run both on one distribution as long as they write to different buckets or prefixes.\nA few practical notes from the documentation:\n\n- CloudFront doesn't charge for enabling standard logs. You pay for the destination: S3 storage and requests, or CloudWatch/Firehose ingestion.\n\n- Logging changes can take up to 12 hours to take effect.\n\n- CloudFront never deletes log files, so add an S3 lifecycle rule to expire old ones.\n\nThe queries below use the legacy tab-delimited format delivered to S3, because it's the most common setup. If you use v2 with JSON or Parquet, the column names are the same idea. Athena has matching table definitions for  \n\n[JSON](https://docs.aws.amazon.com/athena/latest/ug/create-cloudfront-table-manual-json.html)and[Parquet with partition projection](https://docs.aws.amazon.com/athena/latest/ug/create-cloudfront-table-partition-parquet.html).\n## 2. Create the Athena table\n\nThis is the table definition from the  \n\n[Athena documentation for CloudFront standard logs](https://docs.aws.amazon.com/athena/latest/ug/create-cloudfront-table-standard-logs.html). Replace the bucket path with yours:\n\n```\nCREATE EXTERNAL TABLE IF NOT EXISTS cloudfront_standard_logs (  `date` DATE,  time STRING,  x_edge_location STRING,  sc_bytes BIGINT,  c_ip STRING,  cs_method STRING,  cs_host STRING,  cs_uri_stem STRING,  sc_status INT,  cs_referrer STRING,  cs_user_agent STRING,  cs_uri_query STRING,  cs_cookie STRING,  x_edge_result_type STRING,  x_edge_request_id STRING,  x_host_header STRING,  cs_protocol STRING,  cs_bytes BIGINT,  time_taken FLOAT,  x_forwarded_for STRING,  ssl_protocol STRING,  ssl_cipher STRING,  x_edge_response_result_type STRING,  cs_protocol_version STRING,  fle_status STRING,  fle_encrypted_fields INT,  c_port INT,  time_to_first_byte FLOAT,  x_edge_detailed_result_type STRING,  sc_content_type STRING,  sc_content_len BIGINT,  sc_range_start BIGINT,  sc_range_end BIGINT)ROW FORMAT DELIMITEDFIELDS TERMINATED BY '\\t'LOCATION 's3://your-log-bucket/cloudfront/'TBLPROPERTIES ('skip.header.line.count'='2');\n```\n\n`date`  is a reserved word in Athena, so put it in double quotes in your queries.\n## 3. See which crawlers visit and how their requests end\n\nThis query groups the last 30 days of requests by crawler and shows how many succeeded, were blocked or hit a missing page:\n\n```\nWITH bots AS (  SELECT cs_uri_stem, sc_status,    CASE      WHEN cs_user_agent LIKE '%OAI-SearchBot%' THEN 'OAI-SearchBot'      WHEN cs_user_agent LIKE '%ChatGPT-User%'  THEN 'ChatGPT-User'      WHEN cs_user_agent LIKE '%GPTBot%'        THEN 'GPTBot'      WHEN cs_user_agent LIKE '%PerplexityBot%' THEN 'PerplexityBot'      WHEN cs_user_agent LIKE '%ClaudeBot%'     THEN 'ClaudeBot'      WHEN cs_user_agent LIKE '%Googlebot%'     THEN 'Googlebot'      WHEN cs_user_agent LIKE '%bingbot%'       THEN 'bingbot'      WHEN cs_user_agent LIKE '%Applebot%'      THEN 'Applebot'    END AS bot  FROM cloudfront_standard_logs  WHERE \"date\" >= current_date - INTERVAL '30' DAY)SELECT bot,  COUNT(*) AS requests,  COUNT(DISTINCT cs_uri_stem) AS unique_paths,  SUM(CASE WHEN sc_status = 200 THEN 1 ELSE 0 END) AS ok_200,  SUM(CASE WHEN sc_status = 403 THEN 1 ELSE 0 END) AS forbidden_403,  SUM(CASE WHEN sc_status = 404 THEN 1 ELSE 0 END) AS not_found_404FROM botsWHERE bot IS NOT NULLGROUP BY botORDER BY requests DESC;\n```\n\nHow to read the result:\n\n- **No rows for OAI-SearchBot or PerplexityBot at all.** The crawler either isn't finding your site or is being turned away before it gets far. Check robots.txt and WAF, as covered in the[previous article](https://builder.aws.com/content/37s1LBw7NKxCpxcsJKQwWM1qTjV/is-your-aws-setup-blocking-ai-search-crawlers)  .\n\n- **Many 403s.** When AWS WAF blocks a request, CloudFront returns 403 by default. Compare the timestamps with your WAF logs to find the rule responsible.\n\n- **Many 404s.** The crawler is following old or broken URLs. Fix the links or add redirects for pages that moved.\n\n- **Mostly 200s.** Access is working. If you still don't appear in AI answers, the issue is your content, not your infrastructure (see section 6).\n\nThe  \n\n`CASE`  order matters:  `ChatGPT-User`  and  `OAI-SearchBot`  are checked before  `GPTBot` , so each request lands in exactly one bucket. Add other crawlers you care about the same way.\n## 4. See which pages AI search crawlers fetch\n\n```\nSELECT cs_uri_stem,  COUNT(*) AS requests,  MAX(\"date\") AS last_seenFROM cloudfront_standard_logsWHERE \"date\" >= current_date - INTERVAL '30' DAY  AND cs_user_agent LIKE '%OAI-SearchBot%'  AND sc_status = 200GROUP BY cs_uri_stemORDER BY requests DESCLIMIT 50;\n```\n\nCompare the list with the pages that matter most to your business: service pages, pricing and contact. If the crawler spends its visits on tag archives, search pages or old campaign URLs, tighten your internal links and sitemap so the important pages are easy to reach. Swap in  \n\n`PerplexityBot`  or any other user agent to run the same check.\nIt's also worth confirming crawlers can read robots.txt itself:\n\n```\nSELECT \"date\", time, sc_status, cs_user_agentFROM cloudfront_standard_logsWHERE cs_uri_stem = '/robots.txt'  AND \"date\" >= current_date - INTERVAL '7' DAYORDER BY \"date\" DESC, time DESCLIMIT 100;\n```\n\nAnything other than 200 here (especially a 403 or a 200 that returns your HTML homepage) means crawlers can't read your rules.\n\n## 5. Make sure the visitor is really the crawler\n\nUser-agent strings are easy to fake, and scrapers often pretend to be well-known bots. Before you add an allow rule because of what you see in logs, check the  \n\n`c_ip`  values against the IP ranges each company publishes. OpenAI lists the ranges for OAI-SearchBot, GPTBot and ChatGPT-User on its  [crawler overview page](https://developers.openai.com/api/docs/bots), and Google, Microsoft, Apple and Perplexity publish theirs in their crawler documentation.\nIf you use AWS WAF Bot Control, it already does this verification for its \"verified bot\" labels, and the  \n\n[AWS WAF AI activity dashboard](https://aws.amazon.com/about-aws/whats-new/2026/02/aws-waf-ai-activity-dashboard)gives a quick view of AI bot traffic without writing queries. The Athena approach is still useful when WAF isn't in front of your site or you want history beyond what the dashboard shows.\n## 6. Check whether AI answers send you visitors\n\nCrawler visits are only half the picture. The other half is people clicking through from AI answers. This query counts HTML page views referred by ChatGPT or Perplexity:\n\n```\nSELECT \"date\",  COUNT(*) AS visitsFROM cloudfront_standard_logsWHERE \"date\" >= current_date - INTERVAL '30' DAY  AND sc_content_type LIKE 'text/html%'  AND (cs_referrer LIKE '%chatgpt.com%'       OR cs_referrer LIKE '%perplexity.ai%'       OR cs_uri_query LIKE '%utm_source=chatgpt.com%')GROUP BY \"date\"ORDER BY \"date\";\n```\n\nTreat the result as a minimum. Some apps don't pass a referrer, and the way AI tools tag their links has changed more than once, so part of this traffic shows up as \"direct\" in any analytics tool.\n\nIf crawlers fetch your pages successfully but you rarely see referrals or mentions, the next step is content and reputation rather than infrastructure: clear service pages, consistent business listings and trusted mentions on other sites. We wrote a step-by-step guide on that side of the work:  \n\n[How to Rank in ChatGPT: Get Your Business Recommended](https://losangelesseoinc.com/how-to-rank-in-chatgpt/).\n## 7. Keep Athena costs low\n\nAthena charges by the amount of data each query scans. The legacy table above isn't partitioned, so every query reads every log file in the bucket. To keep costs down:\n\n- Always filter by  `\"date\"`  and add`LIMIT`  while exploring.\n\n- Expire old logs with an S3 lifecycle rule.\n\n- For busy sites, switch to standard logging v2 with Parquet output and a  [partitioned Athena table](https://docs.aws.amazon.com/athena/latest/ug/create-cloudfront-table-partition-parquet.html)  , so queries read only the days they need.\n\n## Quick checklist\n\n1. CloudFront standard logging is on, with a lifecycle rule for old files.\n\n1. The Athena table points at your log bucket.\n\n1. OAI-SearchBot, PerplexityBot and the search engine crawlers appear in your logs.\n\n1. Their requests are mostly 200s, not 403s or 404s.\n\n1.  `/robots.txt`  returns 200 to crawlers.\n\n1. The pages crawlers fetch match the pages that matter to your business.\n\n1. Suspicious \"bot\" traffic is checked against published IP ranges before you allow it.\n\n1. Referrals from AI answers are tracked, even if the numbers are a floor.\n\n*Written by Los Angeles SEO Inc, an AI search and growth marketing agency in Los Angeles. Founded in 2013 by Sasan Raeisi.*\n\n**Enjoyed reading this content? Let the author know!**\n\nYour likes, comments, shares, and saves help creators reach more builders.\n\nLoading recommendations", "url": "https://wpnews.pro/news/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena", "canonical_source": "https://builder.aws.com/content/3N1bVvWlRddbWn2BtJe3jewKOQT/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena", "published_at": "2026-12-04 21:36:03+00:00", "updated_at": "2026-12-05 02:13:54.241263+00:00", "lang": "en", "topics": ["ai-crawlers", "ai-search", "generative-engine-optimization"], "entities": ["Amazon Web Services", "CloudFront", "Amazon Athena", "Amazon S3", "CloudWatch Logs", "Data Firehose", "OAI-SearchBot", "PerplexityBot"], "also_reported_by": [], "takeaway": "Enable CloudFront standard logging and query the logs in Athena to group requests by user agent (OAI-SearchBot, ChatGPT-User, GPTBot, PerplexityBot) and count successes, 403 blocks and 404 misses, allowing up to 12 hours for logging changes to take effect and adding an S3 lifecycle rule since CloudF", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena", "markdown": "https://wpnews.pro/news/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena.md", "text": "https://wpnews.pro/news/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena.txt", "jsonld": "https://wpnews.pro/news/which-ai-crawlers-visit-your-site-find-out-with-cloudfront-logs-and-athena.jsonld"}}