Logs powered by Grail can be stored in different buckets. Buckets can improve query performance by reducing query execution time and the scope of data read.
Grail contains built-in Grail buckets with default retention periods. The default built-in bucket intended for log data is default_logs
with a retention period of 35 days
.
To manage your buckets, ensure that you have configured the following permissions:
storage:bucket-definitions:read
storage:bucket-definitions:write
storage:bucket-definitions:delete
storage:bucket-definitions:truncate
With Storage Management you can:
With the Dynatrace API, you can create a custom log bucket tailored to your needs. Using a custom log bucket, you can:
Defining log buckets can improve query performance by reducing query execution time and the scope of data read. Also, you can use buckets to set unique access rules to different logs or log areas.
Permissions can be assigned on the bucket, table, and entity levels. You can set up permissions and choose from six predefined global policies. For details, see:
When configuring a custom log storage retention period, this applies only to the logs that were ingested after you have created the bucket and the rule.
In scenarios where two buckets with varying retention periods can potentially store overlapping logs due to their matchers, the system ensures no duplication by prioritizing the rule that matches first. This guarantees that only the first matching rule governs the storage, preventing redundancy.
To identify the logs directed to specific buckets, use the DQL filter | filter dt.system.bucket == 'bucketName'
.
This filter allows for a targeted view of logs assigned to a particular bucket. However, note that the field dt.system.bucket
isn't included in the default result set. To include it, employ the fields
command: | fields dt.system.bucket,
.
To choose a log bucket for specific log data, create a log bucket rule.
Don't store in a bucket
, the expression needs to match the logs that you do not want to store.Once data is ingested, the bucket it is assigned to can't be changed.
In this example, we need to have a 3-year retention period for the logs whose content contains the word error
.
Create a custom log bucket with a 3-year retention period and name it Logs 3-year retention
.
For details, see Manage custom Grail buckets.
Go to Settings > Log monitoring > Bucket assignment and create a rule.
Error log 3-year retention
.Logs 3-year retention
(the bucket created in the previous step).matchesPhrase(content, "error")
Select Save changes.
This rule will place all ingested log data that matches the phrase error
in the content in the log bucket with the 3-year retention period.
In this example, we need to exclude all logs that have the drop
value in their log.source
attribute.
Exclude drop logs
.Don't store in a bucket
.matchesValue(log.source, "drop")
This rule will exclude log data that has the drop
value in their log.source
attribute.