-
Notifications
You must be signed in to change notification settings - Fork 49
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
[Question] [Help] - Kubernetes metadata or different log_group for namespace #173
Comments
Hi @midestefanis , you can enrich your log with kubernetes metadata using the |
Hi @hossain-rayhan thanks for your answer. Is the kubernetes filter working in this version of fluent-bit? And yes, i have looked into that readme but it doesn't say anything about eks, only ecs. |
@midestefanis The tutorial shows you how to generically use keys in the logs to template the stream/group names. It works with any keys. If you have a key in the logs like
|
Hi @PettitWesley, yes, but to do that the application has to log in with that key. In a large company you cannot make all the applications that want to mount on your infra to have to refactor their logs. The correct approach would be to be able to have the kubernetes metadata (with the kubernetes filter) and add it to it. |
@midestefanis I think you are not understanding my suggestion. You can do the following:
This experience works. We have many customers using it. |
@PettitWesley It doesn't work on eks-fargate. I have already tried it. I found this -> aws/containers-roadmap#1197 |
Oh I did not realize you are an EKS Fargate customer. In that case, yes, you must wait till that roadmap issue is implemented. We know that it is a high priority request that many customers need. |
@PettitWesley I am having trouble with this on EKS too. I can see the metadata from kubernetes but the templating does not work for some reason. My config:
{ |
@vinay-ux The problem might be here:
The templating works only with What is the final log stream name in CW? @hossain-rayhan Can we add a validation so that both prefix and name are an invalid config. |
@PettitWesley I think I understand what you meant. Just to be sure, |
@hossain-rayhan yeah they plugin should fail if they are used together IMO. |
Right, this makes a lot of sense @PettitWesley , thank you very much :) What is the final log stream name in CW? |
Dear @PettitWesley , I have a question about this issue. I want to create log group for each namespace. But it's not working. Is there something I have configured incorrectly? My config.
Exception message Even though I have configured it in the form of $(kubernetes['namespace_name']) as referenced on the https://github.com/aws/amazon-cloudwatch-logs-for-fluent-bit#templating-log-group-and-stream-names page, it seems that the value is not being recognized. Is there anything else I can check? |
I share how I solved.
|
¿Are you planning to add Kubernetes metadata to the logs?, eg:
[FILTER]
Name kubernetes
Match kube.*
Merge_Log On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On
Or how can I collect all the logs of a namespace and send to a specific log_group. Because with the default configuration all the logs go to the same log_group. Default configuration:
[OUTPUT]
Name cloudwatch_logs
Match *
region us-east-1
log_group_name fluent-bit-cloudwatch
log_stream_prefix from-fluent-bit-
auto_create_group true
Without the k8s metadata in the logs and without being able to send the logs of a namespace to a particular log_group I cannot distinguish the different applications.
The text was updated successfully, but these errors were encountered: