The `elasticsearch` module collects metrics about {es}.

[float]
=== Compatibility

The `elasticsearch` module works with {es} 6.7.0 and later.

[float]
=== Usage for {stack} Monitoring

The `elasticsearch` module can be used to collect metrics shown in our {stack-monitor-app}
UI in {kib}. To enable this usage, set `xpack.enabled: true` and remove any `metricsets`
from the module's configuration. Alternatively, run `metricbeat modules disable elasticsearch` and
`metricbeat modules enable elasticsearch-xpack`.

NOTE: When this module is used for {stack} Monitoring, it sends metrics to the
monitoring index instead of the default index typically used by {metricbeat}.
For more details about the monitoring index, see
{ref}/config-monitoring-indices.html[Configuring indices for monitoring].

[float]
=== Module-specific configuration notes

Like other {beatname_uc} modules, the `elasticsearch` module accepts a `hosts` configuration setting.
This setting can contain a list of entries. The related `scope` setting determines how each entry in
the `hosts` list is interpreted by the module.

* If `scope` is set to `node` (default), each entry in the `hosts` list indicates a distinct node in an
  {es} cluster.
* If `scope` is set to `cluster`, each entry in the `hosts` list indicates a single endpoint for a distinct
  {es} cluster (for example, a load-balancing proxy fronting the cluster).
