-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Filebeat] [AWS] Support getting cloudwatch logs from linked cross-account monitoring source accounts #36642
Comments
Can this be addressed soon? |
Hey @tommyers-elastic do you mind if we take over the PR and continue working on it? |
I started looking into this. Note that, while However, once wildcard is removed, [1] - https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_FilterLogEvents.html |
Consider this thread [1]. However, we must control this behaviour through a configuration so that existing users do not get impacted with extra logs. Hence, the property should be disabled by default. And should work in-combination with Proposed property name - [1] - #41188 (comment) |
Thank you so much @Kavindu-Dodan @kaiyan-sheng and everyone else for working on this. Today, I was able to use the elastic agent to pull in logs from a separate AWS account!! For FYI in case it helps anyone else, I am not using CloudWatch cross-account observability. I exec'd into one of the elastic agent pods and created a credentials file located at
where I used IRSA and followed this AWS blog: https://aws.amazon.com/blogs/containers/enabling-cross-account-access-to-amazon-eks-cluster-resources/ , which ensured that the IAM roles have the necessary permissions and trust relationships. Then, in the AWS CloudWatch integration page in Kibana, I told it to use |
We should support cross-account log collection for Cloudwatch. We almost have this functionality today, but there is a small hurdle to overcome, as detailed below.
Cross-account logs are supported by the FilterLogEvents API (which we already use). However there is a caveat hidden away in the docs:
If the log group name is used for log groups in linked source accounts, the request does not succeed. In our cloudwatch logs input, we utilize the log group name exclusively (even parsing the name from the ARN, if provided https://github.com/elastic/beats/blob/main/x-pack/filebeat/input/awscloudwatch/input.go#L72).
In order for cross-account monitoring to work for cloudwatch logs, we need to switch to using log group ARNs and
logGroupIdentifier
in the API requests, instead of log group names (andlogGroupName
).The text was updated successfully, but these errors were encountered: