cloudflare/GCS-Logshare-Setup-Script

Public

mirrored fromhttps://github.com/cloudflare/GCS-Logshare-Setup-Script

CodeCommitsIssuesPull requestsActionsInsightsSecurity
master

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS
SSH

Download ZIP

README.md

37lines · modecode

1# GCS Logshare Setup Script
2
3## Description
4The main.sh script from your local machine creates a GCC VM that runs [Cloudflare's Logshare](https://github.com/cloudflare/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](https://github.com/cloudflare/GCS-To-Big-Query) code.
5
6## Defaults
71. The cron job pushed runs every 1 minute and pulls logs from 10 minutes ago to 11 minutes ago.
82. 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.
9
10## Requirements
11 * [jq](https://github.com/stedolan/jq)
12 * Python 2.7.9
13 * curl
14
15## Setup Instructions
16
171. Select or create a Cloud Platform project:
18 * https://console.cloud.google.com/
192. Clone the GCS Automation Script on your local machine:
20 * ``` git clone https://github.com/cloudflare/GCS-Logshare-Setup-Script.git ```
213. Enable the Service Management API for your project:
22 * https://console.developers.google.com/apis/api/servicemanagement.googleapis.com/overview
234. Configure and enable your Google Billing profile:
24 * https://support.google.com/cloud/answer/6293499#enable-billing
255. Enable the following Google APIs [here](https://console.cloud.google.com/apis/library):
26 * Google Cloud Storage,
27 * Google BigQuery,
28 * Cloud Function
296. Create a copy of default.config.json and rename to config.json
30 * ``` mv config.default.json config.json ```
317. Modify config.json with your cloudflare account details
32 * Cloudflare_api_key - Cloudflare API Key
33 * Cloudflare_api_email - Cloudflare user account email address
34 * Zone_name - domain name; example: mydomain.com
35 * Gcs_project_id - Google Cloud Project ID
368. Run the main orchestration script:
37 * ``` bash main.sh ```