# Metricbeat bad request error

**URL:** https://discuss.elastic.co/t/metricbeat-bad-request-error/312074
**Category:** Beats
**Tags:** metricbeat
**Created:** [August 15, 2022, 7:23am UTC](https://discuss.elastic.co/t/metricbeat-bad-request-error/312074 "2022-08-15T07:23:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Moe\_Hmaidan](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@Moe\_Hmaidan](https://discuss.elastic.co/u/Moe_Hmaidan)
#### Post date: [August 15, 2022, 7:23am UTC](https://discuss.elastic.co/t/metricbeat-bad-request-error/312074/1 "2022-08-15T07:23:56Z")

</div>

Hello, I keep getting the following Errors by metricbeat

> ERROR#011module/wrapper.go:259#011Error fetching data for metricset elasticsearch.index: HTTP error 400 in : 400 Bad Request  
> ERROR#011module/wrapper.go:259#011Error fetching data for metricset elasticsearch.index\_summary: HTTP error 400 in : 400 Bad Request

**Our Environment**

> ES Version 7.17.4  
> Beats 7.17.4

**This is my metricbeat.yml**

```auto
  ###################### Metricbeat Configuration Example #######################

# This file is an example configuration file highlighting only the most common
# options. The metricbeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/metricbeat/index.html

# =========================== 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: true

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

# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 5
  index.codec: best_compression
  #_source.enabled: false

# ================================= Dashboards =================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"
  #host: "https://localhost:5000"
  #username: "${user}"
  #password: "${pwd}"
  #ssl.verification_mode: none

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:

# =============================== Elastic Cloud ================================

# These settings simplify using Metricbeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://monitor-es1:9200"]

  # Protocol - either `http` (default) or `https`.
  protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "${mon-server-user}"
  password: "${mon-server-pwd}"
  ssl.verification_mode: certificate
  ssl.certificate_authorities: ["/etc/client/ca.pem"]
  ssl.certificate: "/etc/client/cert.pem"
  ssl.key: "/etc/client/cert.key"
  
# ------------------------------ Logstash Output -------------------------------
#output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

# ================================= Processors =================================

# Configure processors to enhance or manipulate events generated by the beat.

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

```

elasticsearch-xpack.yml

```auto
- module: elasticsearch
  xpack.enabled: true
  scope: node
  period: 10s
  hosts: ["http://localhost:9200"]
  username: "######"
  password: "######"
  ssl.verification_mode: none

```

A couple of things i noticed during debug:-

> 1. Metricbeat System Module is working without any issues and i can see the data on the monitor server
> 
> 2. In the stack monitoring tab I can see the nodes and most of the stats as you can see in the picture.  
> 
> 3. The Overview tab does not show stats anymore(Issue).  
> 
> 4. The Indices tab does not work anymore(Issue)

**Any help would be appreciated.**

---

<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: [September 12, 2022, 9:24am UTC](https://discuss.elastic.co/t/metricbeat-bad-request-error/312074/2 "2022-09-12T09:24:50Z")

</div>

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