Kubernetes - sls crd

2022-01-02
apiVersion: log.alibabacloud.com/v1alpha1
kind: AliyunLogConfig
metadata:
  name: pro-k8s-java
spec:
  project: yqn-hz-log
  machineGroups:
    - k8s-group-cd805758edeba44ffa1819f41762bc5ed
  lifeCycle: 15
  logstore: pro-service-log
  logtailConfig:
    inputType: file
    configName: pro-k8s-java
    inputDetail:
      logType: json_log
      logPath: /opt/web/ws-*/logs
      filePattern: '*.txt'
      advanced:
        tail_size_kb: 1024
        blacklist:
          filepath_blacklist:
            - /opt/web/ws-*/logs/rootlog*.txt
            - /opt/web/ws-*/logs/*.*.txt
            - /opt/web/ws-*/logs/python*
            - /opt/web/ws-*/logs/nodejs*
        force_multiconfig: false
      dockerFile: true
      dockerIncludeLabel:
        io.kubernetes.pod.namespace: pro
      dockerExcludeEnv:
        APP_PORT: ^(9807|9810|9828|9832|20041|40026|43000)$
      maxSendRate: -1
      maxDepth: 0
      shardHashKey: []
      timeFormat: ''
      discardUnmatch: true
      sensitive_keys: []
      timeKey: ''
      dockerExcludeLabel: {}
#      dockerExcludeEnv:
#        APP_PORT: "^(9807|9810|9828|9832|20041|40026|43000)$"
#      plugin:
#         global:
#           DefaultLogQueueSize: 10
#         processors:
#           - detail:
#               SplitSep: ''
#               SplitKey: content
#             type: processor_split_log_string
#           - detail:
#               SourceKey: content
#               ExpandConnector: ''
#               KeepSource: false
#               NoMatchError: true
#               NoKeyError: true
#             type: processor_json
#           - detail:
#               DropKeys:
#                 - log_level
#                 - __tag__:_pod_uid_
#                 - __tag__:__hostname__
#                 - __tag__:__pack_id__
#                 - __tag__:_node_name_
#             type: processor_drop

参考文档:

https://help.aliyun.com/document_detail/74878.html

参数参考:

https://sls.console.aliyun.com/config/ajax/getNew.json?ConfigName=pro-k8s-java&ProjectName=xx-service-log`