Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logging): add aws account id, region and log group as available dynamic partition keys #560

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mrchops1024
Copy link

This feature allows using additional partition keys in the dynamic partitioning process for central logging. Using this, it would be possible to setup the log-filters.json file for the dynamic-partitioning lambda function as follows:

[
    { "logGroupPattern": "*", "s3Prefix": "{{AWS::AccountId}}/{{AWS::Region}}/{{AWS::LogGroup}}" }
]

This will log all log groups to the central logging S3 bucket, with new partitioning keys starting like so:
111111111111/us-west-2/my-log-group/2024/09/04/etc...

This additionally allows configuring more fine-grained lifecycle rules on specific accounts and/or log groups if necessary.

Issue #, if available: N/A

Description of changes: Added 3 optional dynamic partition keys that can be configured in the log-filters.json dynamic partitioning file:

  • {{AWS::AccountId}} - Will be replaced by the account id in which the log event came from
  • {{AWS::Region}} - Will be replaced by the region in which the log event came from
  • {{AWS::LogGroup}} - Will be replaced by the log group name of the log event

This change is backwards compatible as the omission of these variables causes no replacement to occur.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants