A newer version of this documentation is available.

View Latest

Configure XDCR filtering

To set up filtering in XDCR, define a filtering expression when you are creating the XDCR replication.

The filtering expression is a regular expression that filters keys that need to be transmitted from the source cluster to the destination cluster.

Filtering expressions are currently implemented only for the document keys.

The filtering expression becomes a part of the key for replication. Therefore, administrators can create multiple replications to the same destination cluster and bucket as long as the filtering expression is different.

Define a filtering expression

To implement filtering, you must explicitly do it by selecting XDCR  Create Replication  Enable Advanced filtering.

xdcr adv filtering
You cannot change a filtering expression on an existing replication.

It is important to avoid conditions where two replications to the same destination overlap partially or fully. If an overlap occurs, it will waste machine resources since a single key gets replicated multiple times. Overlapping filtering expressions cannot guarantee which of the two replications will replicate the overlapping key instance to the destination faster.

Filtering does not impact conflict resolution and can be used with a conflict resolution based on revision ID (RevID).

You can pause or resume replication with filtering expression without restrictions.

Test a replication filter

For example, if you have installed the Travel-Sample bucket and want to replicate a subset of data to a remote cluster, use the regular expression provided below to test it out:

regular exp - airline*
test key -airline_SFO