---
title: Filter Processor
description: >-
  Learn how to use the Filter processor to send only logs, metrics, or traces
  that match a filter query to the next step in the pipeline.
breadcrumbs: Docs > Observability Pipelines > Processors > Filter Processor
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Filter Processor

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}
Available for:
{% icon name="icon-logs" /%}
 Logs | 
{% icon name="icon-metrics" /%}
 Metrics 
## Overview{% #overview %}

This processor sends all logs or metrics that match the filter query to the next step in the pipeline. Events that do not match the filter query are dropped and are not sent to any subsequent processors or destinations.

**Note**: For all other processor queries, events that don't match the query are sent to the subsequent step in the pipeline. They are not dropped.

## Setup{% #setup %}

To set up the filter processor:

- Define a filter query. See [Logs Search Syntax](https://docs.datadoghq.com/observability_pipelines/search_syntax/logs.md) or [Metrics Search Syntax](https://docs.datadoghq.com/observability_pipelines/search_syntax/metrics.md) for more information.
  - Events that match the query are sent to the next component.
  - Events that don't match the query are dropped.

## Health metrics{% #health-metrics %}

For [component metrics](https://docs.datadoghq.com/observability_pipelines/monitoring_and_troubleshooting/pipeline_usage_metrics.md#component-metrics) and [processor buffer metrics](https://docs.datadoghq.com/observability_pipelines/monitoring_and_troubleshooting/pipeline_usage_metrics.md#processor-buffer-metrics) emitted by all processors, see the [Pipelines Usage Metrics](https://docs.datadoghq.com/observability_pipelines/monitoring_and_troubleshooting/pipeline_usage_metrics.md) documentation. To filter or group by Filter processor metrics, use the tag `component_type:opw_filter`.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Getting Started with Search in Datadog](https://docs.datadoghq.com/getting_started/search.md)
- [Log Management Search Syntax](https://docs.datadoghq.com/logs/explorer/search_syntax.md)
