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

Add Ability To Filter Log Groups By Tag #38

Open
squatched opened this issue Aug 3, 2021 · 0 comments
Open

Add Ability To Filter Log Groups By Tag #38

squatched opened this issue Aug 3, 2021 · 0 comments

Comments

@squatched
Copy link

It would be super useful and more flexible to add the ability to tell the subscriber exactly which log groups to subscribe to by adding a tag name to the CFT parameters. Then the presence of that tag on a log group would indicate that a subscription should occur for the ingester.

This is easy to filter on for the auto subscriber lambda, you just add an eventName of TagLogGroup. Luckily, these two events have the exact same structure (they both include the list of tags and their values in the same place) so the body of the lambda doesn't have to change much at all there, just the addition of the filter logic.

The backfiller lambda though will require a little work as tags don't get passed back as a result of the describe_log_groups() call. Thus, for each log group, a call to list_tags_log_group() will need to be made for each log group. Once known tags are retrieved, then the loop for each log group would need to be adjusted to:

  • Determine if the log group should be subscribed to.
  • Determine if the log group is already subscribed to.
  • If the log group should be subscribed to but isn't, then subscribe to it.
  • If the log group should not be subscribed to but is, then delete the subscription.
  • If the log group should be subscribed to but is by a different lambda arn but the name ends in "-humio_ingester", then delete/create the subscription.
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

No branches or pull requests

1 participant