Get started

Use this page to learn the basics of Cloud Observability logs.

By the end of this page, you’ll know how to send logs to Cloud Observability and query them in the logs tab. The steps below use Vector to send sample logs to Cloud Observability, but you can use any supported integration.

Access to Cloud Observability Logging is available on request. Reach out to your Account Manager to get started.

Step 1: Get your access token

Copy your Cloud Observability access token. You can create and find access tokens in Project settings > Access tokens.

Step 2: Write some logs

To send logs to Cloud Observability, paste the content below in your Vector configuration file, replacing YOUR-ACCESS-TOKEN with your own value.

The configuration sends demo logs to Cloud Observability.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sources:
  sample_logs:
    type: demo_logs
    format: apache_common
    lines:
      - line1
transforms:
  parse_logs:
    type: remap
    inputs:
      - sample_logs
    source: |
      . = parse_apache_log!(string!(.message), "common") 
      .body = del(.message)
      
sinks:
  lightstep_logs:
    type: elasticsearch
    inputs: ["parse_logs"]
    endpoints: ["https://logingest.lightstep.com:443"]
    healthcheck:
      enabled: false
    bulk:
      index: lightstep
    request:
      headers:
        "lightstep-access-token": "YOUR-ACCESS-TOKEN"

Visit Vector’s Elasticsearch sink documentation to learn more about the configuration settings. That plugin works with Cloud Observability because Cloud Observability supports much of Elasticsearch’s API.

Step 3: View your logs

After restarting Vector, go to Cloud Observability and click Logs. By default, Cloud Observability shows all logs written in the past hour:

Demo logs in Cloud Observability

To search the body attribute, click Search logs and enter observability. Cloud Observability shows the results for the selected time range.

You can also use the sidebar to filter logs by other attributes. For example, click status > 301. Cloud Observability displays status = 301 below the Search logs box and returns the relevant logs. To clear the filter, click the x next to status = 301.

Next steps

You’re all set with logging basics in Cloud Observability. Visit these pages to learn more:

  • Log integrations - Configure tools such as Logstash and OpenTelemetry Collector to send logs to Cloud Observability.
  • Explore logs - Learn more about searching logs in Cloud Observability’s logs tab.
  • Query logs - Learn how to query logs in Cloud Observability’s alerts, dashboards, and notebooks.

Updated Sep 28, 2023