Coralogix offers a number of different approaches for collecting logs from your Google Cloud environments including using GCP Log Explorer and Google Cloud Storage.
The tutorial describes how to configure a Logs router to send logs to a Pub/Sub topic and deliver them to Coralogix using a push subscription on the topic.
The main advantage of using a push subscription is that it avoids running any additional software (i.e. functions) in your GCP account which can contribute to operational overhead and costs.
Logging
and Pub/Sub
servicesWhen you create your subscription, you will need to set the correct endpoint URL using the following parameters:
domain
: Your Coralogix domainkey
: Your Coralogix Send-Your-Data API keyapplication
(optional): Overrides the default application namesubsystem
(optional): Overrides the default subsystem namecomputer
(optional): Sets the computer name (otherwise there is no computer name)application_name_source
(optional): Controls how application name is determined when the application
parameter is not set
project_id_label_or_log_name
: Default behavior. The project_id
label will be used first. If it is not available, the second segment of the log name will be used.log_name
: We recommend trying this if you see numeric project IDs in the application name, but would prefer human readable project names. This does not affect folder IDs, which are always numeric.log_message
(optional): Controls how GCP audit logs are transformed
LogEntry
if not specifiedPayload
: parse only payload field content of the log entry as log textLogEntry
: parse whole log entry, for example:{ "spanId": "abcdefghijk", "severity": "INFO", ... "jsonPayload": { ... }, ... "receiveTimestamp": "2023-02-27T10:16:23.544899312Z", "timestamp": "2023-02-27T10:16:20.035098Z", }
To configure the ingestion of GCP log data to Coralogix, we will first create a new topic in Google Cloud Pub/Sub. Then we will configure the topic as a sink in the logs router and configure a subscription to push the data to Coralogix.
STEP 1. Log in to GCP console
STEP 2. Go to Pub/Sub
/ Topics
and create a Topic
STEP 3. Go to Logging
/ Logs Router
and create a Sink
STEP 4. Go to Pub/Sub
/ Subscriptions
and create a Subscription
Need help?
Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.
Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].