Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vsimon opened this issue Apr 9, 2022 · 1 comment
Open

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

vsimon opened this issue Apr 9, 2022 · 1 comment

Comments

@vsimon
Copy link

vsimon commented Apr 9, 2022

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
Copy link
Owner

Hi @vsimon

Thanks for raising this issue.

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

  • print the stream name with -s flag
  • pipe the output to grep

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants