# Configuring metricbeat to collect Kubernetes metrics

**URL:** https://discuss.elastic.co/t/configuring-metricbeat-to-collect-kubernetes-metrics/232221
**Category:** Beats
**Tags:** metricbeat
**Created:** [May 12, 2020, 11:49am UTC](https://discuss.elastic.co/t/configuring-metricbeat-to-collect-kubernetes-metrics/232221 "2020-05-12T11:49:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aman97](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@aman97](https://discuss.elastic.co/u/aman97)
#### Post date: [May 12, 2020, 11:49am UTC](https://discuss.elastic.co/t/configuring-metricbeat-to-collect-kubernetes-metrics/232221/1 "2020-05-12T11:49:53Z")

</div>

Hi Everyone I am configuring metric beat to collect Kubernetes logs ,  
I am using below config  
apiVersion: v1  
kind: ConfigMap  
metadata:  
name: metricbeat-config  
namespace: kube-system  
labels:  
app: metricbeat  
data:  
metricbeat.yml: |-  
metricbeat.config.modules:

# Mounted `metricbeat-daemonset-modules` configmap:

path: ${path.config}/modules.d/\*.yml

# Reload module configs as they change:

reload.enabled: false  
processors:

- add\_cloud\_metadata:  
output.elasticsearch:  
hosts: ["[http://34.69.16.96:8080/](http://34.69.16.96:8080/)"]  
setup.dashboards.enabled: true  
setup.kibana.host: ["[http://35.225.226.65:8080/](http://35.225.226.65:8080/)"]  
#setup.kibana.protocol: "https"  
setup.template.settings:  
index.number\_of\_shards: 5  
index.number\_of\_replicas: 1  
index.number\_of\_routing\_shards: 30

And I am getting bellow error  
eror: error validating "metricbeat-config.yaml": error validating data: [ValidationError(ConfigMap.data.hosts): invalid type for io.k8s.api.core.v1.ConfigMap.d  
ata: got "array", expected "string", unknown object type "nil" in ConfigMap.data.metricbeat.config.modules, unknown object type "nil" in ConfigMap.data.output.e  
lasticsearch, ValidationError(ConfigMap.data.processors): invalid type for io.k8s.api.core.v1.ConfigMap.data: got "array", expected "string", ValidationError(Co  
nfigMap.data.setup.kibana.host): invalid type for io.k8s.api.core.v1.ConfigMap.data: got "array", expected "string", unknown object type "nil" in ConfigMap.data  
.setup.template.settings]; if you choose to ignore these errors, turn validation off with --validate=false

Please help me out I am new to k8s

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 9, 2020, 11:49am UTC](https://discuss.elastic.co/t/configuring-metricbeat-to-collect-kubernetes-metrics/232221/2 "2020-06-09T11:49:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
