> For the complete documentation index, see [llms.txt](https://docs.fluentbit.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluentbit.io/manual/1.9/pipeline/filters/expect.md).

# Expect

Made for testing: make sure that your records contain the expected key and values

The *expect* filter plugin allows you to validate that records match certain criteria in their structure, like validating that a key exists or it has a specific value.

The following page just describes the configuration properties available, for a detailed explanation of its usage and use cases, please refer the following page:

* [Validating and your Data and Structure](/manual/1.9/local-testing/validating-your-data-and-structure.md)

## Configuration Parameters

The plugin supports the following configuration parameters:

| Property                | Description                                                                                                                                                                                                                                                                                                                        |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key\_exists             | Check if a key with a given name exists in the record.                                                                                                                                                                                                                                                                             |
| key\_not\_exists        | Check if a key does not exist in the record.                                                                                                                                                                                                                                                                                       |
| key\_val\_is\_null      | check that the value of the key is NULL.                                                                                                                                                                                                                                                                                           |
| key\_val\_is\_not\_null | check that the value of the key is NOT NULL.                                                                                                                                                                                                                                                                                       |
| key\_val\_eq            | check that the value of the key equals the given value in the configuration.                                                                                                                                                                                                                                                       |
| action                  | action to take when a rule does not match. The available options are `warn` , `exit` or "result\_key". On `warn`, a warning message is sent to the logging layer when a mismatch of the rules above is found; using `exit` makes Fluent Bit abort with status code `255`; `result_key` is to add a matching result to each record. |
| result\_key             | specify a key name of matching result. This key is to be used only when 'action' is 'result\_key'.                                                                                                                                                                                                                                 |

## Getting Started

As mentioned on top, refer to the following page for specific details of usage of this filter:

* [Validating and your Data and Structure](/manual/1.9/local-testing/validating-your-data-and-structure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fluentbit.io/manual/1.9/pipeline/filters/expect.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
