Step 4: Create a subscription filter - Amazon CloudWatch Logs
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 4: Create a subscription filter

Switch to the sending account, which is 111111111111 in this example. You will now create the subscription filter in the sending account. In this example, the filter is associated with a log group containing Amazon CloudTrail events so that every logged activity made by "Root" Amazon credentials is delivered to the destination you previously created. For more information about how to send Amazon CloudTrail events to CloudWatch Logs, see Sending CloudTrail Events to CloudWatch Logs in the Amazon CloudTrail User Guide.

When you enter the following command, be sure you are signed in as the IAM user or using the IAM role that you added the policy for, in Step 3: Add/validate IAM permissions for the cross-account destination.

aws logs put-subscription-filter \ --log-group-name "aws-cloudtrail-logs-111111111111-300a971e" \ --filter-name "firehose_test" \ --filter-pattern "{$.userIdentity.type = AssumedRole}" \ --destination-arn "arn:aws:logs:us-east-1:222222222222:destination:testFirehoseDestination"

The log group and the destination must be in the same Amazon Region. However, the destination can point to an Amazon resource such as a Firehose stream that is located in a different Region.