Closed murech closed 4 months ago
There are multiple ways to achieve this:
tail
input's path
param, you can only capture the files for your namespacesazure
output or kubernetes
filter you can only catch specific tags to your namespace.Your podname and namespace is embedded into the log file names.
Since the tail
input plugin supports tag expansion, you get the full log path (with podnames and namespace) in your tag.
See this document for more info and concrete example.
Many thanks for your input, @kforeverisback. I was able to route namespaces with the following configuration:
input-kubernetes.conf: |
[INPUT]
Name tail
Tag kube.vault.*
Path /var/log/containers/*vault*.log
Parser docker
DB /var/log/flb_kube.db
Mem_Buf_Limit 5MB
Skip_Long_Lines On
Refresh_Interval 10
output-azure.conf: |
[OUTPUT]
Name azure
Match kube.vault.*
Customer_ID ${FLUENT_AZURE_WORKSPACE_ID_VAULT}
Shared_Key ${FLUENT_AZURE_WORKSPACE_KEY_VAULT}
I have now another problem when I try to write to a Log Analytics Workspace that is in another subscription than the AKS cluster. I'm getting the following error message:
[ warn] [output:azure:azure.0] http_status=403
2024-04-05T16:07:31.358868992Z [2024/04/05 16:07:31] [error] [engine] chunk '1-1712333240.111923211.flb' cannot be retried: task_id=0, input=tail.0 > output=azure.0
403 = permissions error. We are using managed identities for our AKS cluster. Do we have to give the managed identity access to the Log Analytics Workspace?
@murech the Match
configuration should not cause any issues with Azure access.
How were you sending the data before? Based on the config it looked like you were using SharedKey and Workspace ID.
Currently, FluentBit's Azure plugin doesn't support Managed Identity yet from Microsoft Entra ID (formerly Azure AD).
It uses SharedKey and Workspae ID, it shouldn't depend on tenants or subscriptions. See this Log Analytics REST API document.
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale
label.
This issue was closed because it has been stalled for 5 days with no activity.
I'm able to parse k8s logs for all namespace and send these to Azure Log Analytic Workspace with the ConfigMap below. However, I was not able to send only the logs for one specified namespace (for example: podinfo). Can you please tell me how I can filter namespaces?
ConfigMap:
Log file for namespace
podinfo
: