Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 286
Satyendra Kumar Avatar asked Jun 20 '26 22:06

Satyendra Kumar


1 Answers

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

like image 125
samtoddler Avatar answered Jun 23 '26 16:06

samtoddler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!