diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index f732e24f3881..fe7064ed32b0 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -58,6 +58,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Improve detection of file deletion on Windows. {pull}10747[10747] - Fix goroutine leak happening when harvesters are dynamically stopped. {pull}11263[11263] - Fix `add_docker_metadata` source matching, using `log.file.path` field now. {pull}11577[11577] +- Add missing Kubernetes metadata fields to Filebeat CoreDNS module, and fix a documentation error. {pull}11591[11591] *Heartbeat* diff --git a/filebeat/docs/modules/coredns.asciidoc b/filebeat/docs/modules/coredns.asciidoc index ce1c95b27af7..749bbd0a9913 100644 --- a/filebeat/docs/modules/coredns.asciidoc +++ b/filebeat/docs/modules/coredns.asciidoc @@ -11,8 +11,7 @@ This file is generated! See scripts/docs_collector.py == Coredns Module This is a filebeat module for coredns. It supports both standalone coredns deployment and -coredns deployment in Kubernetes. Standalone coredns deployment uses the log fileset, while -Kubernetes coredns deployment uses the kubernetes fileset. +coredns deployment in Kubernetes. [float] === Compatibility diff --git a/x-pack/filebeat/module/coredns/_meta/docs.asciidoc b/x-pack/filebeat/module/coredns/_meta/docs.asciidoc index b980046ff56d..d17d8737e2df 100644 --- a/x-pack/filebeat/module/coredns/_meta/docs.asciidoc +++ b/x-pack/filebeat/module/coredns/_meta/docs.asciidoc @@ -6,8 +6,7 @@ == Coredns Module This is a filebeat module for coredns. It supports both standalone coredns deployment and -coredns deployment in Kubernetes. Standalone coredns deployment uses the log fileset, while -Kubernetes coredns deployment uses the kubernetes fileset. +coredns deployment in Kubernetes. [float] === Compatibility diff --git a/x-pack/filebeat/module/coredns/log/ingest/pipeline-json.json b/x-pack/filebeat/module/coredns/log/ingest/pipeline-json.json index 40364fa0b6dd..5825fb5544bc 100644 --- a/x-pack/filebeat/module/coredns/log/ingest/pipeline-json.json +++ b/x-pack/filebeat/module/coredns/log/ingest/pipeline-json.json @@ -26,6 +26,13 @@ "ignore_failure" : true } }, + { + "rename": { + "field": "json.kubernetes", + "target_field": "kubernetes", + "ignore_failure" : true + } + }, { "remove": { "field": ["json", "bufsize"], diff --git a/x-pack/filebeat/module/coredns/log/test/coredns-json.log-expected.json b/x-pack/filebeat/module/coredns/log/test/coredns-json.log-expected.json index 3764287da3c0..503308defcde 100644 --- a/x-pack/filebeat/module/coredns/log/test/coredns-json.log-expected.json +++ b/x-pack/filebeat/module/coredns/log/test/coredns-json.log-expected.json @@ -20,6 +20,14 @@ "event.module": "coredns", "fileset.name": "log", "input.type": "log", + "kubernetes.container.name": "coredns", + "kubernetes.labels.k8s-app": "kube-dns", + "kubernetes.labels.pod-template-hash": "86c58d9df4", + "kubernetes.namespace": "kube-system", + "kubernetes.node.name": "minikube", + "kubernetes.pod.name": "coredns-86c58d9df4-jwhsg", + "kubernetes.pod.uid": "d57d545e-2a9d-11e9-995f-08002730e0dc", + "kubernetes.replicaset.name": "coredns-86c58d9df4", "log.level": "INFO", "log.offset": 0, "message": "2019-02-12T00:27:28.903Z [INFO] 172.17.0.4:36413 - 21583 \"A IN httpbin.org.cluster.local. udp 43 false 512\" NXDOMAIN qr,rd,ra 136 0.000102078s", @@ -53,6 +61,14 @@ "event.module": "coredns", "fileset.name": "log", "input.type": "log", + "kubernetes.container.name": "coredns", + "kubernetes.labels.k8s-app": "kube-dns", + "kubernetes.labels.pod-template-hash": "86c58d9df4", + "kubernetes.namespace": "kube-system", + "kubernetes.node.name": "minikube", + "kubernetes.pod.name": "coredns-86c58d9df4-jwhsg", + "kubernetes.pod.uid": "d57d545e-2a9d-11e9-995f-08002730e0dc", + "kubernetes.replicaset.name": "coredns-86c58d9df4", "log.level": "INFO", "log.offset": 550, "message": "2019-03-19T02:57:23.213Z [INFO] 172.17.0.9:37723 - 6966 \"A IN httpbin.org. udp 29 false 512\" NOERROR qr,rd,ra 83 0.000082083s\n", @@ -86,6 +102,14 @@ "event.module": "coredns", "fileset.name": "log", "input.type": "log", + "kubernetes.container.name": "coredns", + "kubernetes.labels.k8s-app": "kube-dns", + "kubernetes.labels.pod-template-hash": "86c58d9df4", + "kubernetes.namespace": "kube-system", + "kubernetes.node.name": "minikube", + "kubernetes.pod.name": "coredns-86c58d9df4-jwhsg", + "kubernetes.pod.uid": "d57d545e-2a9d-11e9-995f-08002730e0dc", + "kubernetes.replicaset.name": "coredns-86c58d9df4", "log.level": "INFO", "log.offset": 1081, "message": "2019-03-11T07:16:34.013Z [INFO] [::1]:37915 - 62762 \"AAAA IN czbaoyu.com. udp 29 false 512\" NOERROR qr,rd,ra 100 0.00006286s\n",