Skip to content
v2.274.0

Distribution Enum ​

The method used to distribute log data to the destination.

Example ​

ts
import * as destinations from 'aws-cdk-lib/aws-logs-destinations';
import * as kinesis from 'aws-cdk-lib/aws-kinesis';

declare const stream: kinesis.Stream;
declare const logGroup: logs.LogGroup;

new logs.SubscriptionFilter(this, 'Subscription', {
  logGroup,
  destination: new destinations.KinesisDestination(stream),
  filterPattern: logs.FilterPattern.allTerms("ERROR", "MainThread"),
  filterName: 'ErrorInMainThread',
  distribution: logs.Distribution.RANDOM,
});

Members ​

MemberDescription
BY_LOG_STREAMLog events from the same log stream are kept together and sent to the same destination.
RANDOMLog events are distributed across the log destinations randomly.

Referenced by ​