{"id":22903153,"url":"https://github.com/l480/cloudflare-log-analytics","last_synced_at":"2026-04-13T01:39:44.430Z","repository":{"id":224781286,"uuid":"764209592","full_name":"L480/cloudflare-log-analytics","owner":"L480","description":"📃 Ingests Cloudflare Logs to Azure Log Analytics Workspaces","archived":false,"fork":false,"pushed_at":"2024-12-12T09:37:31.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T13:05:48.959Z","etag":null,"topics":["azure","azure-log-analytics","azure-monitor","cloudflare","cloudflare-workers","logging"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/L480.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"ko_fi":"L480_"}},"created_at":"2024-02-27T17:12:48.000Z","updated_at":"2024-12-12T09:37:36.000Z","dependencies_parsed_at":"2024-04-06T20:44:13.805Z","dependency_job_id":null,"html_url":"https://github.com/L480/cloudflare-log-analytics","commit_stats":null,"previous_names":["l480/cloudflare-log-analytics"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/L480/cloudflare-log-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L480%2Fcloudflare-log-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L480%2Fcloudflare-log-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L480%2Fcloudflare-log-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L480%2Fcloudflare-log-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/L480","download_url":"https://codeload.github.com/L480/cloudflare-log-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L480%2Fcloudflare-log-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-log-analytics","azure-monitor","cloudflare","cloudflare-workers","logging"],"created_at":"2024-12-14T02:34:29.176Z","updated_at":"2026-04-13T01:39:44.414Z","avatar_url":"https://github.com/L480.png","language":"JavaScript","funding_links":["https://ko-fi.com/L480_"],"categories":[],"sub_categories":[],"readme":"# cloudflare-log-analytics\n\nIngests Cloudflare Logs to Azure Log Analytics Workspaces.\n\n![Azure Portal](/images/azure-portal.png \"Azure Portal\")\n\nThis is a [Cloudflare Tail Worker](https://developers.cloudflare.com/workers/observability/logging/tail-workers/) that sends Cloudflare Workers logs to [Azure Log Analytics Workspaces/Azure Monitor Logs](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-workspace-overview) through the [Logs Ingestion API in Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview).\n\n## Prerequisites\n\n- [Cloudflare Workers Paid Plan](https://developers.cloudflare.com/workers/platform/pricing/)\n- Azure Subscription\n\n## Setup\n\n### Azure\n\n- [Create a Microsoft Entra application](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#create-azure-ad-application) to authenticate against the API.\n- [Create a data collection endpoint (DCE)](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#create-data-collection-endpoint) to receive data.\n- [Create a custom table in a Log Analytics workspace](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#create-new-table-in-log-analytics-workspace). This is the table you'll be sending data to. As part of this process, you will create a data collection rule (DCR) to direct the data to the target table.\n- [Give the AD application access to the DCR](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#assign-permissions-to-the-dcr).\n\n### Cloudflare\n\n- Set up a Worker in Cloudflare and add the [below](#environment-variables) `ARM_CLIENT_SECRET` environment variable as secret.\n- Modify the rest of the [environment variables](#environment-variables) in [wrangler.toml](./wrangler.toml) and [deploy it to Cloudflare](https://developers.cloudflare.com/workers/wrangler/commands/#deploy).\n- Add the following to the wrangler.toml file of the producer Worker:\n\n    ```toml\n    tail_consumers = [{service = \"law-ingestion\"}]\n    ```\n\n## Environment Variables\n\n| Variable name     | Description                              | Example                                                                                                                                                                                                                                                                                                                                                                   |\n| ----------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| ARM_TENANT_ID     | Azure tenant ID                          | `40a009eb-76f8-4d32-bca3-893aaebd0f41`                                                                                                                                                                                                                                                                                                                                    |\n| ARM_CLIENT_ID     | Client ID of Azure service principal     | `cd96fd2a-8b49-4df0-bd0c-8d396d97c259`                                                                                                                                                                                                                                                                                                                                    |\n| ARM_CLIENT_SECRET | Client secret of Azure service principal | `fII8Q~FO.qbSmcpxpyZqfsbv.7nz46X4_4HutaHw`                                                                                                                                                                                                                                                                                                                                |\n| DCE_URL           | Data Collection Endpoint URL             | `https://cloudflare-logging-asu8.westeurope-1.ingest.monitor.azure.com/dataCollectionRules/dcr-1e5cc3ed115842ecb647b43f4d8bafef/streams/Custom-CfLogging_CL?api-version=2023-01-01`\u003cbr\u003e [*DCR immutable ID is only visible in JSON view!*](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-portal#collect-information-from-the-dcr) |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl480%2Fcloudflare-log-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl480%2Fcloudflare-log-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl480%2Fcloudflare-log-analytics/lists"}