---
title: ContextPropertiesFilters System Parameter - Remove Context Properties with RegEx
description: ContextPropertiesFilters removes context properties whose names match case-insensitive RegEx filters from Log Events before they are stored, in the Log API and the Logging Service. Use it to drop sensitive data and save disk space in Nodinite.
---

# ContextPropertiesFilters - System Parameter

The **ContextPropertiesFilters** [System Parameter][System Parameters] removes context properties from [Log Events][Log Event] when their names match a regular expression ([RegEx][]). Use it to keep sensitive data, such as passwords and keys, out of the [Log Databases][], and to save disk space. Context properties and the reserved [Context Options][] keys are described with the Log Event.

![An invoice Log Event with five Context Values, two of them named Contoso.Debug#, ContextPropertiesFilters opened from the System Parameters list and given one filter that removes names starting with Contoso.Debug#, saved, then a new invoice event stored with only three Context Values while the earlier event still has all five, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: one filter removes the `Contoso.Debug#` context properties. A new invoice event is stored without them, while the event logged before the change keeps all five. The [Log API][] and the [Logging Service][] were restarted off camera so the change applied at once.*

1. Open a Log Event's **Context Values** tab: five values, two of them named `Contoso.Debug#...`.
2. Filter the [System Parameters][] list on *ContextProperties* and open **ContextPropertiesFilters**.
3. Add one filter, `^Contoso\\.Debug#`, that removes names starting with `Contoso.Debug#`. **Save**.
4. Log a new invoice event: it's stored without the `Contoso.Debug#` values.
5. Open the earlier event: it still has all five. Only new events are filtered.

## :fa-table: At a Glance {#at-a-glance}

| Property | Value |
| --- | --- |
| Key | `ContextPropertiesFilters` |
| Data type | json |
| Default | `null` (no filtering) |
| Read by | [Log API][] and [Logging Service][] |
| Takes effect | Within about 15–20 minutes (the Log API keeps the filters 20 minutes, the Logging Service 15); restart both to apply a change at once |
| Status | ✅ Active |
| Since | :Nodinite: 6.0.0.11 |

## :fa-gears: How It Works

The [Log API][] applies the filters to every event it receives, so matching data never enters :Nodinite:. The [Logging Service][] applies them while it processes events from other sources, and when Log Events are re-indexed. In both places, each context property's name is compared with the enabled filters, and a property whose name matches is removed before it is stored. Events stored before a change keep their context properties.

Nothing is filtered when the value is `null` or when the global `Enabled` is `false`.

> [!IMPORTANT]
> Filtering **permanently removes** data; a removed context property can't be restored by a re-index. Test your expressions before you enable them in production.

> [!WARNING]
> Never remove `http://schemas.microsoft.com/BizTalk/2003/system-properties#MessageExchangePattern`. The Logging Service uses it to set the correct [Event Direction][Event Directions] for Log Events from BizTalk Server.

To hide a value but keep the context property, use [ProtectedContextValues][] instead.

## :fa-code: Value Format

The value is a JSON object with these properties:

| Property | Type | Meaning |
| --- | --- | --- |
| `Enabled` | boolean | Global switch. `false` turns all filtering off. |
| `Filters` | array | The filter entries. |
| `Filters[].RegExFilter` | string | Regular expression matched against the context property name. Case-insensitive; each expression may run for at most 1 second per context property. An expression that doesn't compile is skipped and logged; the others still apply. |
| `Filters[].Description` | string | Optional. Describes the intent of the entry. |
| `Filters[].Enabled` | boolean | Turns a single entry on or off, so you can keep an expression while you experiment. |

```json
{
  "Enabled": true,
  "Filters": [
    {
      "RegExFilter": "password",
      "Description": "Removes all context properties with password in the name (case-insensitive)",
      "Enabled": true
    },
    {
      "RegExFilter": "http://schemas.microsoft.com/BizTalk/2003/file-properties#SecretKey",
      "Description": "Removes the secret key used on dynamic send ports",
      "Enabled": true
    }
  ]
}
```

*Example: remove every context property with "password" in its name, and the BizTalk Server secret key property.*  

## :fa-lightbulb: Choosing a Value

* Fewer, broader expressions perform better than many narrow ones; one RegEx can cover several property names.
* Keep expressions simple so they finish well within the 1-second limit.
* Use `Filters[].Enabled` to switch an entry off instead of deleting it.

## :fa-hand-point-right: Next Steps

* :fa-list-check: [Context Options][]  
* :fa-hard-drive: [Logging Service][]  
* :fa-pen-to-square: [Manage System Parameters][]  

## :fa-link-horizontal: Related Topics

* :fa-key: [ProtectedContextValues][] - Mask context values instead of removing them  
* :fa-eye-slash: [HideAdditionalFieldValuesInLogViews][] - Show, hide, or mask built-in event fields  
* :fa-search-minus: [HideSearchFieldValuesInLogViews][] - Hide [Search Field][Search Fields] values not in the [Log View][Log Views]  
* :fa-arrows-left-right: [Event Directions][]  
* :fa-database: [Log Databases][]  
* :fa-cog: [System Parameters][]  

[Context Options]:{ndr}/Core%20Services/Log%20Event/Features/Context%20Options.md
[Event Directions]:{ndr}/Core%20Services/Log%20Event/Features/Event%20Directions.md
[Hero]:{ndm}/Documentation%20Pictures/IM/CoreServices/ConfigurationDatabase/SystemParameters/SystemParameters_ContextPropertiesFilters.gif
[HideAdditionalFieldValuesInLogViews]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/HideAdditionalFieldValuesInLogViews.md
[HideSearchFieldValuesInLogViews]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/HideSearchFieldValuesInLogViews.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[Log Databases]:{ndr}/Core%20Services/Log%20Databases/Overview.md
[Log Event]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Logging Service]:{ndr}/Core%20Services/Logging%20Service/Overview.md
[Manage System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Manage%20System%20Parameters.md
[ProtectedContextValues]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/ProtectedContextValues.md
[RegEx]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/regex.md
[Search Fields]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md
[System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Overview.md