Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Conversation

zlseu-edu
Copy link
Contributor

support custom all filebeat config.

ENV aliyun_logs_custom_config mount the user defined configs in configmap.

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: customconfig
data:
  config: |
    catalina.fields.service=nginx-log
    catalina.multiline.pattern='^\['
    catalina.multiline.negate=true
    catalina.multiline.match=after
---
apiVersion: v1
kind: Pod
metadata:
  name: tomcat
spec:
  containers:
  - name: tomcat
    image: "tomcat:7.0"
    env:
    # 1、stdout为约定关键字,表示采集标准输出日志
    # 2、配置标准输出日志采集到ES的catalina索引下
    - name: aliyun_logs_catalina
      value: "stdout"
    # 1、配置采集容器内文件日志,支持通配符
    # 2、配置该日志采集到ES的access索引下
    - name: aliyun_logs_access
      value: "/usr/local/tomcat/logs/catalina.*.log"
    - name: aliyun_logs_custom_config
      valueFrom:
        configMapKeyRef:
          name: customconfig
          key: config
    # 容器内文件日志路径需要配置emptyDir
    volumeMounts:
    - name: tomcat-log
      mountPath: /usr/local/tomcat/logs
  volumes:
  - name: tomcat-log
    emptyDir: {}

@codecov-io
Copy link

Codecov Report

Merging #244 into master will decrease coverage by 0.32%.
The diff coverage is 13.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
- Coverage   21.79%   21.46%   -0.33%     
==========================================
  Files           7        7              
  Lines         748      778      +30     
==========================================
+ Hits          163      167       +4     
- Misses        557      581      +24     
- Partials       28       30       +2
Impacted Files Coverage Δ
pilot/pilot.go 26.17% <18.75%> (-0.26%) ⬇️
pilot/piloter.go 20% <7.14%> (-30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0948b2c...c9f9aa7. Read the comment docs.

@Colstuwjx
Copy link

Colstuwjx commented Dec 10, 2019

Ping @jzwlqx @chenquanzhao , Shall we take a review about this PR? I also need this feature.

root := newLogInfoNode("")
for _, k := range labelNames {
for _, prefix := range p.logPrefix {
customConfig := fmt.Sprintf(ENV_SERVICE_LOGS_CUSTOME_CONFIG_TEMPL, prefix)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方 去遍历 labelNames。 你这边来匹配ENV_SERVICE_LOGS_CUSTOME_CONFIG_TEMPL。 是不是手误? @zlseu-edu #332

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants