Satyendra Kumar
Satyendra Kumar

Reputation: 21

AWS CLI cloudwatch log subscription without any filter pattern

I'm trying to get logs from an application running in AWS, including all logs without any filter pattern:

aws logs put-subscription-filter --log-group-name "abc-loggroup" --filter-name "Destination" --filter-pattern "" --destination-arn "arn:test" --role-arn "arn:role"

getting following error - aws: error: argument --filter-pattern: expected one argument

Tried running the command without "--filter-name" parameter it failed.

How can I run this command without any filter pattern

Upvotes: 2

Views: 742

Answers (1)

samtoddler
samtoddler

Reputation: 9605

As per the documentation PutSubscriptionFilter, you need to provide both params.

filterPattern

A filter pattern for subscribing to a filtered stream of log events.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1024.

Required: Yes

filterName

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Pattern: [^:]

Required: Yes

Upvotes: 1

Related Questions