# Elasticsearch monitoring with metricbeat not working as expected

**URL:** https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088
**Category:** Metrics
**Tags:** elastic-stack-monitoring
**Created:** [February 21, 2023, 3:25pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088 "2023-02-21T15:25:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ramdas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramdas/32/110363_2.png) [@ramdas](https://discuss.elastic.co/u/ramdas)
#### Post date: [February 21, 2023, 3:25pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088/1 "2023-02-21T15:25:43Z")

</div>

Hi,

i am using metricbeat for elasticsearch monitoring and the monitoring indexes are created with pattern like .ds-.monitoring-es-8-mb-\* and i can see data is also coming in. however when i go to stack monitoring it says no monitoring data found.

i can confirm there is enough monitoring data like almost a week and still it says no monitoring data found. i do not know what else to check?? any help?

---

<div class="post-metadata">

### Author: ![ingri.mahecha](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ingri.mahecha](https://discuss.elastic.co/u/ingri.mahecha)
#### Post date: [February 21, 2023, 7:59pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088/2 "2023-02-21T19:59:47Z")

</div>

Hello,

How do you have the Metricbeat configuration?

---

<div class="post-metadata">

### Author: ![ramdas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramdas/32/110363_2.png) [@ramdas](https://discuss.elastic.co/u/ramdas)
#### Post date: [February 22, 2023, 4:18pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088/3 "2023-02-22T16:18:22Z")

</div>

Hi,

Thanks for your response. below is my config file for metricbeat

```auto
metricbeat.yml:
setup:
  template:
    enabled: true
    name: "${INDEX_NAME:cluster-metrics}"
    pattern: "${INDEX_NAME:cluster-metrics}-*"
    fields: "fields.yml"
    settings:
      index.number_of_shards: 1
      index.number_of_replicas: 1
      index.lifecycle.name: "bmap_obsv_ilm_policy"
  ilm:
    enabled: false
  kibana:
    host: "${KIBANA_HOST:kibana.example.com:5601}"
    protocol: "${KIBANA_PROTOCOL:https}"
    ssl.verification_mode: "${KIBANA_VERIFYSSL:none}"
    username: "${KIBANA_USERNAME:kibana}"
    password: "${KIBANA_PASSWORD:welcome1}"

logging:
  level: "${LOG_LEVEL:warning}"
  to_stderr: true
  json: true

metricbeat.modules:
- module: prometheus
  metricsets: ["remote_write"]
  host: "localhost"
  port: "8080"

- module: kubernetes
  enabled: true
  metricsets:
    - state_node
    - state_deployment
    - state_replicaset
    - state_pod
    - state_container
  period: 10s
  hosts: ["${KUBE_STATE_METRICS_HOSTS:kube-state-metrics:8080}"]
  ssl.verification_mode: "none"

- module: kubernetes
  metricsets:
    - container
    - node
    - pod
    - system
    - volume
  period: 1m
  host: "${NODE_NAME}"
  hosts: ["https://${NODE_NAME}:10250"]
  bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  ssl.verification_mode: "none"
  processors:
  - add_kubernetes_metadata: ~

- module: kubernetes
  enabled: true
  metricsets:
    - event

- module: elasticsearch
  xpack.enabled: true
  scope: node
  metricsets:
    - node
    - node_stats
    - index
    - index_recovery
    - index_summary
    - shard
    - cluster_stats
    - enrich
    - pending_tasks
  period: 10s
  hosts: ["https://localhost:${ES_NODEPORT}"]
  username: "${ELASTICSEARCH_USERNAME}"
  password: "${ELASTICSEARCH_PASSWORD}"
  ssl.verification_mode: "certificate"

- module: system
  period: 1m
  metricsets:
    - cpu
    - load
    - memory
    - network
    - process
    - process_summary
  processes: ['.*']
  process.include_top_n:
    by_cpu: 5
    by_memory: 5

- module: system
  period: 1m
  metricsets:
    - filesystem
    - fsstat

  processors:
  - drop_event.when.regexp:
      system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

  - add_cloud_metadata: ~

metricbeat.autodiscover:
  providers:
    - type: kubernetes
      hints.enabled: true

output.elasticsearch:
  hosts: "[${ELASTICSEARCH_HOST}:9200]"
  protocol: "${ELASTICSEARCH_PROTOCOL:https}"
  username: "${ELASTICSEARCH_USERNAME:elastic}"
  ssl.verification_mode: "${ELASTICSEARCH_VERIFYSSL:none}"
  password: "${ELASTICSEARCH_PASSWORD:welcome1}"
  index: "${INDEX_NAME}-%{[agent.version]}-%{+yyyy.MM.dd}"
  allow_older_versions: true

```

i am using Elasticsearch and metricbeat with version 8.3.3. hope this helps for you to identify issue

---

<div class="post-metadata">

### Author: ![ingri.mahecha](https://avatars.discourse-cdn.com/v4/letter/i/51bf81/32.png) [@ingri.mahecha](https://discuss.elastic.co/u/ingri.mahecha)
#### Post date: [February 22, 2023, 5:57pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088/4 "2023-02-22T17:57:29Z")

</div>

To configure the INDEX PATTERN settings you must configure the following:

**metricbeat.yml**

```auto
# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression
setup.template.name: "logs-rds.nameofindex-default"
setup.template.pattern: "logs-rds.nameofindex-default"
setup.ilm.enabled: false
output.elasticsearch.index: "logs-rds.nameofindex-default"

```

for example if you are using a module, simply leave the following configuration in the input

```auto
# =========================== Modules configuration ============================

metricbeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

  # Period on which files under path should be checked for changes
  #reload.period: 10s

```

to activate the modules I leave you the guide  
[[Configure modules | Metricbeat Reference [master] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/master/configuration-metricbeat.html)](Configure modules)

Then go to your elastisearch  
**Menu -\> Management -\> Stack Management-\> Data -\>Index Management**

In the **Data Stream** option you verify that data is arriving and then go to

**Menu -\> Management -\> Stack Management-\> Kibana -\>Data views**

Create the **index pattern**

To create the **template** for the fields of this configuration in the path  
**Menu -\> Management -\> Stack Management-\> Data -\>Index Management**

In the **Index template** option look for the name of your Index and select **EDIT** , there in the mapping part you can add the Fields in Json format an example:

```auto
{
  "properties": {

    "@timestamp": {
      "type": "date"
    },
	
	"data_stream.​dataset":{
	"type":"constant_keyword"
	},
	
	"data_stream.​namespace":{
	"type":"constant_keyword"
	}
}
}

```

I hope this explanation helps you a little

---

<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: [March 22, 2023, 5:57pm UTC](https://discuss.elastic.co/t/elasticsearch-monitoring-with-metricbeat-not-working-as-expected/326088/5 "2023-03-22T17:57:35Z")

</div>

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