Logs are stored in Grail buckets with a retention period from 10 days to 10 years. By default, log data is stored for 35 days in the default_logs bucket.
In this tutorial, you'll learn how to store your log data in retention buckets based on specific retention periods. We'll examine three different examples:
This tutorial is intended for Site Reliability Engineers (SREs) and architects who want to configure storage and retention settings for access control, optimization, or compliance purposes.
In this tutorial, you'll learn how to:
Using buckets can improve query performance by reducing query execution time and the scope of data read. With this procedure, you create a new bucket with a custom retention period for your log data. Log records that match the route and the pipeline conditions are stored according to the chosen bucket retention period and are readable to users based on permissions.
Using a custom log bucket, you can:
For more information, see Best practices for Log Management and Analytics.
With this example, you skip the storage of logs that match the route and pipeline conditions. Log records aren't stored.
This can be useful when you parse log lines and extract metrics, and access to original records isn't needed.
To skip storage for selected log records
When you configure No storage assignment, the record continues through all configured pipeline stages and is not stored only at the end of the pipeline. This means you can extract metrics and generate alerts from records that you won't store.
There are two retention models that you can configure on a per-bucket basis:
For more information, see Take control of log query costs using Retain with Included Queries.
You've completed this tutorial.
Buckets are the foundation of log management—set them up right to avoid data silos and optimize retention. A few best practices can make a big difference in performance and cost. For more information, see Best practices for Log Management and Analytics.