# Filters

> Allow or deny DataItems by Category, Type, ID, or an Expression, and reduce data with Period and Delta filters.

URL: https://www.trakhound.com/docs/mtconnect-server/filters

By default, every DataItem of a Profile's Devices is stored and published. A Profile's **Filter** tab selects the DataItems to include, and reduces how often their values are sent. Each Profile has its own Filter, so the same Device can store everything in a database while only publishing its alarms to MQTT.

## Allow and Deny

- When the **Allow** list is empty, all DataItems are allowed. Otherwise, only the DataItems matching an Allow pattern are included.
- DataItems matching a **Deny** pattern are always left out.

Patterns are added with the picker, which lists the DataItems of the Profile's Devices:

| Mode | Selects |
| --- | --- |
| **By Category** | SAMPLE, EVENT, or CONDITION DataItems |
| **By Type** | A Type (ex. `EXECUTION`), or a Type and SubType (ex. `POSITION` ↳ `ACTUAL`) |
| **By ID** | A single DataItem, by its ID |
| **Expression** | A pattern typed in (below). Click an example to use it |

### Expressions

| Expression | Matches |
| --- | --- |
| `*` | All DataItems |
| `category=CONDITION` | All Conditions |
| `type=EXECUTION` | Execution DataItems |
| `type=POSITION&subtype=ACTUAL` | Actual Positions (conditions are joined with `&`) |
| `id=avail` | The DataItem with the ID `avail` |
| `representation=TIME_SERIES` | Time Series DataItems |
| `/*` | DataItems of the Device itself (not in a Component) |
| `type=Controller/**` | All DataItems below Controllers |
| `type=Linear/type=POSITION` | Positions of Linear Axes |

DataItems can be matched by `id`, `name`, `type`, `subtype`, `category`, `representation`, `units`, `native_units`, and `coordinate_system`. A `/` separates Components (matched by `id`, `name`, or `type`), `*` matches any one Component, and `**` matches any number of levels.

### Match Preview

The Filter previews which DataItems it matches (ex. **Matches 42 of 120 DataItems on 2 Devices**), using each Device's Probe from its Agent, or the stored Device model when the Agent can't be reached. The picker shows how many of each Category and Type are matched.

![A Profile's Filter tab, with the picker By Type and the Match Preview](https://www.trakhound.com/img/screenshots/previews/mtconnect-server-profile-filter.webp)

## Presets

**Presets** are ready made changes to the Filter. Applying one writes ordinary settings into the Filter, which can then be seen, edited, and removed like any others.

| Preset | What It Sets |
| --- | --- |
| **Exclude constantly changing values** | Denies the Types that change all the time a machine runs: `POSITION`, `PATH_POSITION`, `ANGLE`, `ROTARY_VELOCITY`, `AXIS_FEEDRATE`, `PATH_FEEDRATE`, `LOAD`, `TORQUE`, `ACCUMULATED_TIME`, `CLOCK_TIME`, `LINE_NUMBER`, `LINE`, and `BLOCK`. |
| **Faults only** | Keeps Conditions at the FAULT level, and what ends each one. Warnings and other levels are left out. |

## Condition Levels

**Condition Levels** keep only some levels of Conditions: **Fault**, **Warning**, **Normal**, and **Unavailable**. A level that's left out is still kept when it ends a kept one, such as the NORMAL that clears a kept FAULT, so the stored alarms always have an end.

## Period and Delta Filters

| Filter | Description |
| --- | --- |
| **Period Filter** | Skips values that change more often than the minimum period (milliseconds). Use it to reduce fast changing values, such as positions. |
| **Delta Filter** | Skips numeric values that change by less than the minimum delta. Use it to ignore small changes, such as noise on a temperature. |

> Filters don't apply to MTConnect Assets. A Tables Profile stores every Asset of its Devices when **Store Assets** is on.
