[[filtering-and-enhancing-data]]
== Filtering and Enhancing the Exported Data

When your use case requires only a subset of the data exported by Metricbeat or you need to add metadata,
you can <<metricbeat-filtering-overview,use Metricbeat config options to filter
the data>>, or you can  <<defining-processors,define processors>>.


[float]
[[metricbeat-filtering-overview]]
=== Metricbeat Module Filtering

Each module accepts a list of filters in its configuration. These filters are
applied to the data generated by the module. These filters are applied to the
module data prior to the addition of the common beat fields like `beat.hostname`
and `type` so they can only be used to filter fields from the module.

The following example reduces the exported fields of the Redis module to
include only the `redis.info.memory` fields.

[source,yaml]
----
metricbeat.modules:
- module: redis
  metricsets: ["info"]
  period: 1s
  hosts: ["127.0.0.1:6379"]
  enabled: true
  filters:
    - include_fields:
       fields: ['memory']
----

[float]
[[defining-processors]]
=== Defining Processors

include::../../libbeat/docs/processors.asciidoc[]

For example, the following filters configuration reduces the exported fields by
dropping the `beat.name` and `beat.hostname` fields under `beat`, from all documents.

[source, yaml]
----
processors:
 - drop_fields:
    fields: ['beat']
----

See <<configuration-processors>> for more information.
