> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/flow/rules/filter.md).

# FILTER

The Filter rule allows you to filter events that meet specific criteria. This is particularly useful when you want to control the volume of data being stored or processed. For example, if you do not want to store debug or info logs, you can create a Filter rule that drops all log lines that contain these levels.

In addition to dropping entire log lines, Filter rules can also be configured to drop specific fields within a log line. This can be useful when you only want to retain certain fields of interest.

### To Create a Filter Rule:

Open **Configure Pipeline**, click **Add Rule** under **Rules**, then select **FILTER**. Complete the shared fields and condition in [Rules](/flow/rules.md).

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FCWSXTaLnsGExhVHhl0Tf%2FScreenshot%20from%202026-09-18%2015-00-05.png?alt=media&amp;token=986c3bfb-b828-4b4a-9f65-5c0f2ac626ea" alt=""><figcaption></figcaption></figure>

Select preview data before choosing **Drop Labels** or condition fields. Fields load from **Pipeline Preview**. You can also type a label manually.

The FILTER form appears in **Pipeline Configuration**. It has three sections for filtering, field removal, and event suppression.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fzs1PBs4GThsJJ7v2XTaX%2FScreenshot%20from%202026-09-18%2020-02-07.png?alt=media&amp;token=3404a689-57e3-4372-bf38-4fb13c1bfa34" alt=""><figcaption></figcaption></figure>

**With filter rule:**

1. Logs can be dropped based on a condition.
2. Labels within the logs can be dropped.
3. Duplicate events can be suppressed in intervals.

The first section contains shared details and the condition builder.

Then, enter the necessary details for your Filter Rule, including a name for the rule, the group it belongs to, and any parameters needed to filter your log data.

Use **+ Add more parameters** to add conditions. Conditions can use fields like log severity level or timestamp.

### Filter Logs:

Use FILTER to remove unwanted logs from the pipeline. By default, all logs are dropped when no condition is configured. When a condition is provided, only logs matching that condition are dropped.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F2uZzSy8bDq5Ru0sXhHtx%2FScreenshot%20from%202026-09-21%2012-26-45.png?alt=media&amp;token=aed914cf-8a7a-4221-bab0-b925c91bd901" alt=""><figcaption></figcaption></figure>

Click **Save** in the footer to save the rule.

#### Pipeline Preview

From the left panel, select the **Dataflow** tab under the **IN** tab. Select the desired **Namespace** and **Application**. You can change the page size if required; the default page size is **10**.

The following image shows that the rule drops messages with `status == 200`.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FZgliN0cPiulhYmub0kQo%2FScreenshot%20from%202026-09-21%2012-27-25.png?alt=media&amp;token=5396499d-55d1-412b-afeb-3c72f73c85ff" alt=""><figcaption></figcaption></figure>

### Filter Fields:

When creating a Filter Rule, users can choose to filter selected fields instead of dropping the entire log line. This can be particularly useful when logs contain metadata like Kubernetes labels that may not be needed for long-term storage or analysis.

To enable field filtering, switch over to the `Drop Labels` section and toggle the `Enable Drop Labels` . Select or enter the fields you wish to filter in the `Labels to Drop` dropdown. This will ensure that only the selected fields are dropped from the log line, while other fields will still be retained.

By using field filtering in combination with the Filter Rule, you can ensure that your log data is efficiently managed and stored, with only the necessary fields retained for further analysis.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FWCp4iudHGNQX1PuTrX3z%2FScreenshot%20from%202026-09-21%2015-27-43.png?alt=media&amp;token=855a5dbe-ad4d-4760-a3d9-a8db4d1d4bc6" alt=""><figcaption></figcaption></figure>

#### Pipeline Preview - drop labels

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FGOoFiqdreJVe1Imef6pJ%2FScreenshot%20from%202026-09-21%2015-31-02.png?alt=media&amp;token=fc48da7c-846c-4585-b056-85718422cd5f" alt=""><figcaption></figcaption></figure>

### Suppress Events:

The filter rule can also help you drop duplicates in an interval. At the end of every interval, a certain number of logs will be allowed to flow ahead in the pipeline. To suppress events, click on the last section in the filter rule called \`Suppress Events\` and toggle `Enable Suppress Events`.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fq36b9NNzUD6zZiy0uHis%2FScreenshot%20from%202026-09-21%2015-34-44.png?alt=media&amp;token=2bb037a9-89d8-400d-83e0-ec03f383b119" alt=""><figcaption></figcaption></figure>

#### Pipeline Preview - suppress events

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F4TpK9OBXAkQuIfHoVUSJ%2FScreenshot%20from%202026-09-21%2015-34-50.png?alt=media&amp;token=73559fa4-bc21-43ef-beb8-f1210962d567" alt=""><figcaption></figcaption></figure>

By default, the rule will drop duplicates and allow only a single log to go through. The logs that are allowed to go through will contain an extra field in the log event that is the count of suppressed logs.

Once you have created a Filter Rule and specified your filter criteria in the first tab(`Details`), all incoming log lines that match the criteria will be evaluated for de-duplication before they are sent to storage or downstream systems. This can help to control the volume of data being stored and ensure that only relevant data is retained for further analysis.

In addition to creating custom Filter Rules, Apica Ascent also offers many inbuilt Filter Rules for various applications like Java, ingress, auditd, Kubernetes, and more. These pre-built rules can be easily accessed and configured to suit your specific needs, making it easy to filter out unnecessary data from your log streams.
