GCS Logshare Setup Script
Description
The main.sh script from your local machine creates a GCC VM that runs Cloudflare's Logshare tool on a cron schedule to push Enterprise Logs to BigQuery. Logs are written to GCS and then automatically pushed into BigQuery using the GCS-To-Big-Query code.
Defaults
- The cron job pushed runs every 1 minute and pulls logs from 10 minutes ago to 11 minutes ago.
- The ELS endpoint's fields are subject to change. At the time the VM is built, we cache a local version of the available fields. This is subject to change, but can be updated manually by modifying the fields.txt file.
Requirements
Setup Instructions
- Select or create a Cloud Platform project:
- Clone the GCS Automation Script on your local machine:
git clone https://github.com/cloudflare/GCS-Logshare-Setup-Script.git
- Enable the Service Management API for your project:
- Configure and enable your Google Billing profile:
- Enable the following Google APIs here:
- Google Cloud Storage,
- Google BigQuery,
- Cloud Function
- Create a copy of default.config.json and rename to config.json
mv config.default.json config.json
- Modify config.json with your cloudflare account details
- Cloudflare_api_key - Cloudflare API Key
- Cloudflare_api_email - Cloudflare user account email address
- Zone_name - domain name; example: mydomain.com
- Gcs_project_id - Google Cloud Project ID
- Run the main orchestration script: