# LogGroupTargetInputOptions

Options used when creating a target input template.

- Source: [`aws-events-targets/lib/log-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-events-targets/lib/log-group.ts#L16)
- Type last changed: v2.29.0 · 23 Jun 2022

## Example

```ts
import * as logs from 'aws-cdk-lib/aws-logs';
declare const logGroup: logs.LogGroup;
declare const rule: events.Rule;

rule.addTarget(new targets.CloudWatchLogGroup(logGroup, {
  logEvent: targets.LogGroupTargetInput.fromObjectV2({
    timestamp: events.EventField.fromPath('$.time'),
    message: events.EventField.fromPath('$.detail-type'),
  }),
}));
```

## Properties

- `message`: any = EventField.detailType — The value provided here will be used in the Log "message" field.

  This field must be a string. If an object is passed (e.g. JSON data)
  it will not throw an error, but the message that makes it to
  CloudWatch logs will be incorrect. This is a likely scenario if
  doing something like: EventField.fromPath('$.detail') since in most cases
  the `detail` field contains JSON data.

- `timestamp`: any = EventField.time — The timestamp that will appear in the CloudWatch Logs record.
