-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Issue: Using the Filebeat Elasticsearch module in combination with Kubernetes autodiscover results in logs in the incorrect filesets or duplicate filesets:

Expected behavior: Each log message should only appear in the destination a single time, and it should have the appropriate fields associated with the fileset of that log (i.e. server, audit, deprecation, gc, etc.)
- Version: 7.6.0
- Operating System: GKE Container Optimized OS
- Steps to Reproduce:
Deploying Filebeat using Filebeat Helm chart with values.yaml:
filebeat:
# Allows you to add any config files in /usr/share/filebeat
# such as filebeat.yml
filebeatConfig:
filebeat.yml: |-
filebeat.autodiscover:
providers:
- type: kubernetes
node: ${NODE_NAME}
hints.enabled: true
processors:
- add_cloud_metadata:
- add_host_metadata:
output.elasticsearch:
hosts: 'http://${ELASTICSEARCH_ADDRESS}'
username: ${ELASTICSEARCH_USERNAME}
password: ${ELASTICSEARCH_PASSWORD}
extraEnvs:
- name: ELASTICSEARCH_USERNAME
valueFrom: { secretKeyRef: { name: beats-elasticsearch, key: username } }
- name: ELASTICSEARCH_PASSWORD
valueFrom: { secretKeyRef: { name: beats-elasticsearch, key: password } }
- name: ELASTICSEARCH_ADDRESS
valueFrom: { secretKeyRef: { name: beats-elasticsearch, key: address } }
imageTag: 7.6.0
extraVolumeMounts:
- name: varlog
mountPath: /var/log/
readOnly: true
extraVolumes:
- name: varlog
hostPath:
path: /var/log/
In this case Elasticsearch was deployed using ECK, with annotations in the podTemplate to enable the Elasticsearch module:
podTemplate:
metadata:
annotations:
co.elastic.logs/module: "elasticsearch"
I am attaching the filebeat.log file, the json of the documents from the above screenshot, and the contents of the bulk request that show the documents are being to the corresponding pipelines for each fileset (4 copies of the same document).
The appropriate pipelines were installed in Elasticsearch prior to these logs being ingested:
