1

I am interested in pod logs. I am trying to ship logs from AWS EKS to cloudwatch using below fluent-bit deamon set in EKS

https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluent-bit/fluent-bit.yaml

I am applying it, but it creates the log stream in format. How can I just have instance name and pod name in it? Can someone help?

The current format is

ip-10-11-97-64.ec2.internal-application.var.log.containers.sonarqube-sonarqube-dce-search-0_sonarqube-dce_sonarqube-dce-search-b892adb2fbf60a36568c3578c20181941dc8f6d00a8180cb837f9f76ecaa515a.log

I am interested to have log stream name as instancename_namespacename_podname

1 Answer 1

1

This is totally possible using the variables log_stream_name or if you want some regex log_stream_prefix in ConfigMap resource before applying it.

You can download the yaml from the Github raw link, then edit it by changing in the ConfigMap:

log_stream_prefix   ${HOST_NAME}.

to something like:

log_stream_prefix    /eks/$(kubernetes['namespace_name'])/$(kubernetes['pod_name'])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.