# RealtimeLogConfigProps

Properties for defining a RealtimeLogConfig resource.

Extends: RealtimeLogConfigProps
Used as props by: RealtimeLogConfig

- Source: [`aws-cloudfront/lib/realtime-log-config.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cloudfront/lib/realtime-log-config.ts#L31)
- Type last changed: v2.94.0 · 1 Sep 2023

## Example

```ts
// Adding realtime logs config to a Cloudfront Distribution on default behavior.
import * as kinesis from 'aws-cdk-lib/aws-kinesis';

declare const stream: kinesis.Stream;

const realTimeConfig = new cloudfront.RealtimeLogConfig(this, 'realtimeLog', {
  endPoints: [
    cloudfront.Endpoint.fromKinesisStream(stream),
  ],
  fields: [
    'timestamp',
    'c-ip',
    'time-to-first-byte',
    'sc-status',
  ],
  realtimeLogConfigName: 'my-delivery-stream',
  samplingRate: 100,
});

new cloudfront.Distribution(this, 'myCdn', {
  defaultBehavior: {
    origin: new origins.HttpOrigin('www.example.com'),
    realtimeLogConfig: realTimeConfig,
  },
});
```

## Properties

- `endPoints`: [Endpoint](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.Endpoint.html)[] (required) — Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration.

- `fields`: string[] (required) — A list of fields that are included in each real-time log record.

- `realtimeLogConfigName`: string — The unique name of this real-time log configuration.

  **Default:** the unique construct ID

- `samplingRate`: number (required) — The sampling rate for this real-time log configuration.
