Replies: 3 comments
-
同问 |
Beta Was this translation helpful? Give feedback.
0 replies
-
请问可以提供一份您的配置,以及Pod的yaml吗? |
Beta Was this translation helpful? Give feedback.
0 replies
-
同样的问题 loongcollector配置如下 apiVersion: v1
data:
nginx_stdout.yaml: |
enable: true
inputs:
- Type: input_file
FilePaths:
- /home/cnp/cnp-nginx/logs/*.log
EnableContainerDiscovery: true
Multiline:
StartPattern: '[\d\.:]+.*'
ExternalK8SLabelTag:
app.ccc.comstar/instance: service
app: app
ExternalEnvTag:
COMSTAR_APP_DEPLOY_ENV: deploy_env
COMSTAR_ENV: comstar_env
ContainerFilters:
K8sNamespaceRegex: "^(dev)$"
IncludeK8sLabel:
app: nginx # choose containers with this label
flushers:
- Type: flusher_stdout
OnlyStdout: true
Tags: true
kind: ConfigMap
metadata:
name: loongcollector-user-cm
namespace: dev 采集模板pod配置如下
loongcollector收集到的日志如下 2025-02-28T14:51:49.275631429+08:00 2025-02-28 06:51:49 [LogGroup] topic , logstore , logcount 1, tags
[Key:"__pack_id__" Value:"4C99A88CAF55C6D2-2"
Key:"__path__" Value:"/home/cnp/cnp-nginx/logs/access.log"
Key:"_container_ip_" Value:"10.51.30.120"
Key:"_container_name_" Value:"nginx"
Key:"_image_name_" Value:"harbor.comstar:8443/cnp/cnp-nginx:1.23.1"
Key:"_namespace_" Value:"dev" Key:"_pod_name_" Value:"nginx-868dbf49bc-8vmnr"
Key:"_pod_uid_" Value:"ad5e68e0-010c-493b-8594-6a761fa51576"
Key:"_node_name_" Value:"worker02"
Key:"_node_ip_" Value:"172.19.195.9"
Key:"__hostname__" Value:"loongcollector-ds-kx7nd" ]
```tag值为空
loongcollector配置如下
```yaml
apiVersion: v1
data:
nginx_stdout.yaml: |
enable: true
inputs:
- Type: input_file
FilePaths:
- /home/cnp/cnp-nginx/logs/*.log
EnableContainerDiscovery: true
Multiline:
StartPattern: '[\d\.:]+.*'
ExternalK8SLabelTag:
app.ccc.comstar/instance: service
app: app
ExternalEnvTag:
COMSTAR_APP_DEPLOY_ENV: deploy_env
COMSTAR_ENV: comstar_env
ContainerFilters:
K8sNamespaceRegex: "^(dev)$"
IncludeK8sLabel:
app: nginx # choose containers with this label
flushers:
- Type: flusher_stdout
OnlyStdout: true
Tags: true
kind: ConfigMap
metadata:
name: loongcollector-user-cm
namespace: dev 采集模板pod配置如下
loongcollector收集到的日志如下 2025-02-28T14:51:49.275631429+08:00 2025-02-28 06:51:49 [LogGroup] topic , logstore , logcount 1, tags
[Key:"__pack_id__" Value:"4C99A88CAF55C6D2-2"
Key:"__path__" Value:"/home/cnp/cnp-nginx/logs/access.log"
Key:"_container_ip_" Value:"10.51.30.120"
Key:"_container_name_" Value:"nginx"
Key:"_image_name_" Value:"harbor.comstar:8443/cnp/cnp-nginx:1.23.1"
Key:"_namespace_" Value:"dev" Key:"_pod_name_" Value:"nginx-868dbf49bc-8vmnr"
Key:"_pod_uid_" Value:"ad5e68e0-010c-493b-8594-6a761fa51576"
Key:"_node_name_" Value:"worker02"
Key:"_node_ip_" Value:"172.19.195.9"
Key:"__hostname__" Value:"loongcollector-ds-kx7nd" ] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
2.0版本input中文本日志输出插件的ExternalK8sLabelTag配置项不生效,日志输出不能携带pod的标签信息。容器标准输出是可以携带的,这是什么原因?

ilogtail采用的是daemonset部署的,开启了EnableContainerDiscover
Beta Was this translation helpful? Give feedback.
All reactions