---
title: "Filtering for Rules"
canonical: "https://docs.infoblox.com/space/netmri760/357369879/Filtering%20for%20Rules"
format: markdown
---
A rule should not operate on all possible objects, or the rule would never finish executing in a policy or would yield results that don't match the intent of the rule. You use filters to ensure the following:

- Ensure that a policy rule applies only to particular devices that you want the rule to match against;
- Ensure matches against characteristics such as Rank, Assurance level, device model and numerous other criteria.

Configure rule and policy filters carefully. It is possible to inadvertently specify mutually exclusive filters such that a policy would not apply to any configuration file.

To specify a filter for a rule, do the following:

1. In the **Rules** panel, select the rule.
2. Click the **Add** **device** **filter** hyperlink. The **Edit** **Filters** dialog appears.
3. Click **Add** **Device** **Attribute**. The **Edit Device Attribute** dialog box appears.
4. (Optional) Enter a **Note** describing the filter element.
5. Select a device filtering characteristic from the first dropdown (e.g. **Assurance**, **Community**, **DNS** **Name**, **Model**, **Name,** or another characteristic (see *[Adding Device Attributes to a Rule Filter](https://infoblox-docs.atlassian.net/wiki/spaces/netmri760/pages/357370252)*).
6. Select an operator from the list (e.g., **=**, **=>**, **in**, **Contains**, **Does** **Not** **Contain**, or any other operator).
7. Enter or paste in the text for the configuration file line(s) or the value to match against.
8. If you want to use more than one filtering criterion, click **Apply** **and** **New**.
9. Click **OK** when the new filter is complete.

When you create new rules, you can also add filters to them. After doing so, they are listed under the **Device** **Filter** **for** **Rule** section in the center pane. You can do so for any rule, whether it is a new one or a read-only rule bundled with the appliance.  
You can also choose a **Config** **File** **Match** for the rule filter. However, while the filter can check for a line or a series of lines in the config file (using Must Contain... or May Not Contain... statements for the matching), the match of this type is used only to determine whether the rule will apply to a given device.