TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.4k stars 77 forks source link

Grepping to select a log group #17

Closed furudean closed 5 years ago

furudean commented 5 years ago

Hi, first of all - awesome tool!

At my company, we sometimes have a lot of log groups, and long names for groups. This leads to a lot of copy paste when starting to watch or read a log. It would be awesome if you could write a part of a groups name to automatically select that group.

If you have /aws/lambda/company-project-backend-getSomething, searching getSomething would pick this group, provided it's the only match. If there are multiple matches then it could let you pick from a list of matching logs.

Alternatively a --grep flag/argument or similar could be used with the command to let you enable this functionality.

will-ockmore commented 5 years ago

As the functionality to print out the groups exists, you can do this already! Just have to get creative using other tools.

You could of course use grep itself but for situations like this I really like fzf. In bash (give it a try!):

saw watch $(saw groups | fzf)
furudean commented 5 years ago

This is awesome, thanks! Time to make an alias.