addK8sMeta

Used to get from some fields in the event (such as the path of the log file).
Source interceptor.

  • pod.uid
  • namespace and pod.name
  • container.id

With any one of the above three kinds of index information, Loggie can query the specific Pod according to the index, and add additional kubernetes meta-information such as ${node.name}, ${namespace}, ${pod.uid}, ${pod.name}, etc. to the event for subsequent analysis and processing.

Example

  1. interceptors:
  2. - type: addK8sMeta
  3. pattern: "/var/log/${pod.uid}/${pod.name}/"
  4. addFields:
  5. nodename: "${node.name}"
  6. namespace: "${namespace}"
  7. podname: "${pod.name}"

pattern

字段类型是否必填默认值含义
patternstringtrueMatching model for extracting fields

Must contain one of:

  • pod.uid
  • namespace and pod.name
  • container.id

For example: /var/log/${pod.uid}/${pod.name}/

patternFields

字段类型是否必填默认值含义
patternFieldsstringfalseBy default, the filename in the system field will be obtained from the event. In this case, you need to use the file sourceFields for the extracting pattern from the event

fieldsName

字段类型是否必填默认值含义
fieldsNamestringfalsekubernetesFields to add meta information

addFields

字段类型是否必填默认值含义
addFieldsmapfalseMeta information to be added

The currently supported meta-information fields are:

  • ${cluster}: Cluster information. discovery.kubernetes.cluster in system configuration.
  • ${node.name}
  • ${namespace}
  • ${workload.kind}: Deployment/StatefulSet/DaemonSet/Job, etc.
  • ${workload.name}: the name of the workload
  • ${pod.uid}
  • ${pod.name}