By default, Observations are kept indefinitely. A Tables Profile's Retention rules delete Observations from the Profile's destinations once they're older than a TTL (Time To Live), so a database doesn't keep growing.
Add a Rule
- Open a Tables Profile (Collection > Configuration > Profiles) and go to its Retention tab.
- Click Add Rule.
- Set Keep Observations For (TTL) in Minutes, Hours, or Days (default 30 days), and optionally a Description.
- Optionally select the DataItems the rule applies to, with Allow and Deny patterns, the same as a Filter. A rule without Allow patterns matches all DataItems.
- Click Save Changes.
How Rules Apply
- The first matching rule applies to each DataItem, so put specific rules before general ones.
- DataItems without a matching rule are kept.
- A rule can be disabled without removing it.
For example, to keep alarms for a year and everything else for 30 days:
| Order | TTL | Allow |
|---|---|---|
| 1 | 365 Days | category=CONDITION |
| 2 | 30 Days | (all DataItems) |
How Retention Runs
Retention runs in the background and deletes in batches, catching up on large backlogs over time. Its progress is shown under Collection > Statistics > Retention: for each rule and Device, the Observations deleted (in total and in the last run), the TTL, when it last ran, whether it's catching up, and any errors (see Monitoring Collection).