A newer version of this documentation is available.

View Latest

Configure XDCR Filtering

Set up filtering in XDCR.

The filtering expression is a regular expression for filtering keys that need to be transmitted from the source cluster to the destination cluster. It is set when creating the XDCR replication.

Filtering expressions are currently implemented only for the document keys.

If you need to replicate to the same destination cluster and bucket with different filtering expressions, you can create a single replication with the filter expression using multiple expressions ORed together as: filterExpression0|filterExpression1.

For example, the expression airline|hotel would match both "unitedairline" and "marriothotel".

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