---
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.

<h2 id="at-a-glance"><i class="fal fa-table" aria-hidden="true"></i> At a Glance</h2>

| 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 | <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 6.0.0.11 |

## <i class="fal fa-gears" aria-hidden="true"></i> How It Works

The [Log API][] applies the filters to every event it receives, so matching data never enters <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>. 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`.

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Filtering <strong>permanently removes</strong> data; a removed context property can't be restored by a re-index. Test your expressions before you enable them in production.</p></div>
</aside>

<aside aria-label="Warning" class="nodinite-note nodinite-note--warning">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-triangle-exclamation"></i> Warning</p>
<div class="nodinite-note__content"><p>Never remove <code>http://schemas.microsoft.com/BizTalk/2003/system-properties#MessageExchangePattern</code>. The Logging Service uses it to set the correct <a href="https://docs.nodinite.com/core-services/log-event/features/event-directions/">Event Direction</a> for Log Events from BizTalk Server.</p></div>
</aside>

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

## <i class="fal fa-code" aria-hidden="true"></i> 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.*  

## <i class="fal fa-lightbulb" aria-hidden="true"></i> 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.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-list-check" aria-hidden="true"></i> [Context Options][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Logging Service][]  
* <i class="fal fa-pen-to-square" aria-hidden="true"></i> [Manage System Parameters][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

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

[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Event Directions]:https://docs.nodinite.com/core-services/log-event/features/event-directions/
[Hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/CoreServices/ConfigurationDatabase/SystemParameters/SystemParameters_ContextPropertiesFilters.gif
[HideAdditionalFieldValuesInLogViews]:https://docs.nodinite.com/administration/settings/system-parameters/hideadditionalfieldvaluesinlogviews/
[HideSearchFieldValuesInLogViews]:https://docs.nodinite.com/administration/settings/system-parameters/hidesearchfieldvaluesinlogviews/
[Log API]:https://docs.nodinite.com/core-services/log-api/overview/
[Log Databases]:https://docs.nodinite.com/core-services/log-databases/overview/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Manage System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/manage-system-parameters/
[ProtectedContextValues]:https://docs.nodinite.com/administration/settings/system-parameters/protectedcontextvalues/
[RegEx]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/regex/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[System Parameters]:https://docs.nodinite.com/administration/settings/system-parameters/overview/