I have ECK setup and running on my kubernetes cluster. I followed the Configuration Examples to setup filebeat ship all container logs to Elasticsearch. That is working fine.
However, now I am trying to parse the logs of my Nginx Ingress Controller using the nginx filebeat module so that I can better search the ingress logs. But I just can't seem to get it to work, no matter how many different examples I see online. This is what my Beat resource looks like:
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
name: container-logs
namespace: elasticsearch
spec:
config:
filebeat:
autodiscover:
providers:
- hints:
default_config:
enabled: false
node: ${NODE_NAME}
templates:
- config:
- paths:
- /var/log/containers/*${data.kubernetes.container.id}.log
type: container
- condition:
equals:
kuberentes.container.name: controller
config:
- ingress_controller:
enabled: true
vars:
paths:
- /var/log/containers/*${data.kubernetes.container.id}.log
module: nginx
type: kubernetes
processors:
- add_cloud_metadata: {}
- add_host_metadata: {}
setup:
dashboards:
enabled: false
daemonSet:
podTemplate:
spec:
automountServiceAccountToken: true
containers:
- env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
name: filebeat
volumeMounts:
- mountPath: /var/log/containers
name: varlogcontainers
- mountPath: /var/log/pods
name: varlogpods
- mountPath: /var/lib/docker/containers
name: varlibdockercontainers
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
securityContext:
runAsUser: 0
serviceAccountName: filebeat
volumes:
- hostPath:
path: /var/log/containers
name: varlogcontainers
- hostPath:
path: /var/log/pods
name: varlogpods
- hostPath:
path: /var/lib/docker/containers
name: varlibdockercontainers
elasticsearchRef:
name: elasticsearch
kibanaRef:
name: kibana
monitoring:
logs: {}
metrics:
elasticsearchRefs:
- name: elasticsearch
namespace: elasticsearch
type: filebeat
version: 8.10.1
Has anyone else gotten this to work on their setup? I feel like I've tried everything.