Export from GitHub to Elasticsearch
CloudQuery is an open-source data integration platform that allows you to export data from any source to any destination.
The CloudQuery GitHub plugin allows you to sync data from GitHub to any destination, including Elasticsearch. It takes only minutes to get started.
GitHub
The CloudQuery GitHub plugin extracts your GitHub API and loads it into any supported CloudQuery destination
Elasticsearch
This plugin is in preview.
The Elasticsearch plugin syncs data from any CloudQuery source plugin(s) to an Elasticsearch cluster
Table of Contents
MacOS Setup
Step 1. Install CloudQuery
brew install cloudquery/tap/cloudquery
Step 2. Log in to CloudQuery CLI
Logging in is required to use premium plugins and premium tables in open-core plugins.
cloudquery login
Step 3. Configure GitHub source plugin
You can find more information about the configuration in the plugin documentation
kind: source
spec:
# Source spec section
name: github
path: cloudquery/github
registry: cloudquery
version: "v10.0.0"
tables: ["github_issues"]
destinations: ["elasticsearch"]
spec:
access_token: "${GITHUB_PERSONAL_ACCESS_TOKEN}" # Personal Access Token, required if not using App Authentication.
# # App Authentication (one per org):
# app_auth:
# - org: cloudquery
# private_key: <PRIVATE_KEY> # Private key as a string
# private_key_path: <PATH_TO_PRIVATE_KEY> # Path to private key file
# app_id: <YOUR_APP_ID> # App ID, required for App Authentication.
# installation_id: <ORG_INSTALLATION_ID> # Installation ID for this org
# # List of organizations to sync from. You must specify either orgs or repos in the configuration.
# orgs: []
# # List of repositories to sync from. The format is `owner/repo` (e.g. `cloudquery/cloudquery`). You must specify either `orgs` or `repos` in the configuration.
# repos: ["cloudquery/cloudquery"]
# # GitHub Enterprise
# # In order to enable GHE you have to provide two urls, the base url of the server and the upload url.
# # Quote from GitHub's client:
# # If the base URL does not have the suffix "/api/v3/", it will be added automatically. If the upload URL does not have the suffix "/api/uploads", it will be added automatically.
# # Another important thing is that by default, the GitHub Enterprise URL format should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code. The upload URL format should be http(s)://[hostname]/api/uploads/"
# # If you are not configuring against an enterprise server please omit the enterprise configuration bellow
# enterprise:
# base_url: "http(s)://[your-ghe-hostname]/api/v3/"
# upload_url: "http(s)://[your-ghe-hostname]/api/uploads/"
# # Optional parameters
# concurrency: 1500 # Optional. The best effort maximum number of Go routines to use. Lower this number to reduce memory usage or to avoid hitting GitHub API rate limits. Default 1500.
# discovery_concurrency: 1 # Optional. Number of concurrent requests to GitHub API during discovery phase. Default 1.
# include_archived_repos: false # Optional. Include archived repositories in the sync. Default false.
# local_cache_path: "" # Optional. Path to a local directory that will hold the cache. If set, the plugin will cache the GitHub API responses in this directory. Defaults to an empty string (no cache).
Step 4. Configure Elasticsearch destination plugin
You can find more information about the configuration in the plugin documentation
kind: destination
spec:
name: elasticsearch
path: cloudquery/elasticsearch
registry: cloudquery
version: "v3.2.10"
write_mode: "overwrite-delete-stale"
spec:
# Elastic Cloud configuration parameters
cloud_id: "${ELASTICSEARCH_CLOUD_ID}"
api_key: "${ELASTICSEARCH_API_KEY}"
# Self-hosted Elasticsearch configuration parameters
# addresses: ["http://localhost:9200"]
# username: ""
# password: ""
# service_token: ""
# certificate_fingerprint: ""
# ca_cert: ""
# Optional parameters
# concurrency: 5 # default: number of CPUs
# batch_size: 1000
# batch_size_bytes: 5242880 # 5 MiB
Step 5. Run Sync
cloudquery sync github.yml elasticsearch.yml