lucagrulla / cw

The best way to tail AWS CloudWatch Logs from your terminal
https://www.lucagrulla.com/cw
Apache License 2.0
792 stars 59 forks source link

Able to have an exact match on the log group prefix? #235

Open vsimon opened 2 years ago

vsimon commented 2 years ago

Is your feature request related to a problem? Please describe.

With a log group "foo" containing multiple log streams like:

service
service-test

When intending to tail just the "service" logs, this command returns both the logs from "service" and "service-test" because argument only lets you specify prefixes <groupName[:logStreamPrefix]>

cw tail -f "foo:service" -b5m

Maybe there's a way to do this that I'm missing to find? I would like just "service" logs but not "service-test" logs to be included in the same tail stream.

Describe the solution you'd like

Maybe something like a --log-stream-exact-match flag and do a filter on the returned log streams with an exact match.

or maybe turn prefixes into regexes, to allow specifying end of line characters and do regex matching on the returned log streams.

cw tail -f "foo:service\$" -b5m
lucagrulla commented 2 years ago

Hi @vsimon

Thanks for raising this issue.

While we work on a fix, you can still use cw to achieve your goals:

cw tail -f "foo:service\$" -b5m -s | grep <your RegEx>