Google Cloud CDN
Route Google Cloud CDN logs to AI Search Index via Cloud Logging Log Sink with Pub/Sub push subscription.
Endpoint
POST
/api/v1/logs/gcp_log_sinkEndpoint URL: https://aisearchindex.com/api/v1/logs/gcp_log_sink
Authorization: Bearer bot_YOUR_BOT_TRACKING_KEYSetup Steps
- 1
Create Pub/Sub Topic
In Google Cloud Console, go to Pub/Sub → Create topic
- 2
Create Push Subscription
Create a subscription for the topic with push delivery:
Delivery type: Push Push endpoint: https://aisearchindex.com/api/v1/logs/gcp_log_sink Authentication: Type: OIDC token Service account: [your-service-account]@[project].iam.gserviceaccount.com Audience: https://aisearchindex.com Or use header-based auth: Add header: Authorization Value: Bearer bot_YOUR_BOT_TRACKING_KEY - 3
Create Log Sink
Go to Cloud Logging → Log Router → Create sink
Sink destination: Cloud Pub/Sub topic Select destination: projects/[project]/topics/[your-topic] Inclusion filter: resource.type="http_load_balancer" httpRequest.requestUrl!="" - 4
Grant Permissions
Grant the log sink's service account the Pub/Sub Publisher role on your topic
Alternative: Using Cloud Functions
For more control over log processing, you can use a Cloud Function to transform and forward logs:
- Create a Pub/Sub-triggered Cloud Function
- Parse the log entries and extract relevant fields
- Forward to our Custom endpoint:
/api/v1/logs/custom
Verify Integration
- Visit your Cloud CDN-served website to generate traffic
- Check Pub/Sub metrics to verify messages are being published
- Check your AI Search Index dashboard for incoming data