Introduction

Google cloud logs streaming allows you to forward logs generated within your Google Cloud Platform (GCP) environment to OpsRamp. By streaming logs to OpsRamp, you can centralize log management, enhance monitoring capabilities, and improve incident response times.

To stream Google Cloud Platform (GCP) logs into OpsRamp, follow below steps to set up a Cloud Pub/Sub Topic and a Logs Routing Sink:

Create a cloud Pub/Sub topic

  1. Sign in to the Google Cloud Platform.

  2. Navigate to the Pub/Sub Topic page.

  3. In the Topics section, click Create Topic.

    The Create Topic details page is displayed.

  4. In the Topic ID field, enter an ID for your topic. Retain the option Add a default subscription and do not select the other options.

  5. For encryption, select Google-managed encryption key.

  6. Click Create Topic.

  7. After creating the topic, navigate to the Subscriptions section and click Edit for the topic you created in the previous step.

  8. Select Delivery Type as Push.

  9. In the Endpoint URL field, enter the OpsRamp HTTP endpoint URL.

  10. Leave all other options as default and click Update.

Logs routing sink

  1. In the Google Cloud Console, navigate to the Logs Router page and select your existing Cloud project.
  2. Click on the Create Sink action.
  3. In the Sink details panel, enter the following information:
    • Sink name: Provide an identifier for the sink.
    • Sink description (optional): Describe the purpose or use case for the sink.
  4. In the Sink destination panel, select the sink service and destination:
    • Select sink service: Choose “Cloud Pub/Sub Topic”.
    • Select a cloud Pub/Sub Topic: Select the topic created in the previous step.
  5. In the Choose logs to include in sink panel enter the following information:
    • In the Build inclusion filter field, enter a filter expression that matches the log entries you want to include. If no filter is set, all logs from your selected resource are routed to the destination.
  6. (Optional) In the Choose logs to filter out of sink" panel:
    • In the Exclusion filter name field, enter a name.
    • In the Build an exclusion filter field, enter a filter expression that matches the log entries you want to exclude. You can also use the sample function to select a portion of the log entries to exclude.
  7. Click Create Sink.

Once this configuration setup is completed in Google Cloud Platform, you can analyze logs in the OpsRamp Logs Explorer.

Supported labels

When integrating Googl cloud logs with OpsRamp, the following labels can be used to categorize and manage your log data effectively:

  • logName
  • projectId
  • podName
  • namespaceName
  • location
  • containerName
  • clusterName
  • resourceType
  • severity