Standard Output Configuration
You can add a standard output tag to collect the standard output logs of the corresponding containers in a pod. Add the following field to spec:template:metadata:annotations: in the YAML file of the pod to specify the names of the containers whose data is to be collected:
kubernetes.AOM.log.stdout: '["container_name0", "container_name1"]'
The rules are as follows:
- If the kubernetes.AOM.log.stdout: field does not exist, the standard output logs of all containers in the pod are collected by default. This rule is compatible with original scenarios.
- If this field exists and its value is empty, that is, kubernetes.AOM.log.stdout: '[]', the standard output logs of containers in the pod will not be collected.
Example:
spec:
replicas: 1
selector:
matchLabels:
app: als729
version: v1
template:
metadata:
creationTimestamp: null
labels:
app: als729
version: v1
annotations:
kubernetes.AOM.log.relabel: '{"key1":"value1","key2":"value2","key3":"value3","key4":"value4","key5":"value5","key6":"value6","key7":"value7","key8":"value8","key9":"value9","key10":"value10","key11":"value11","key12":"value12","key13":"value13","key14":"value14","key15":"value16"}'
kubernetes.AOM.log.stdout: '["container-0","container_name1"]' Last Article: Adding Custom Tags
Next Article: Configuration Management
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.