TylerBrock / saw

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

How to get a specific stream? #64

Closed yellowtailfan closed 3 years ago

yellowtailfan commented 3 years ago

Great tool. I'm trying it out to make it faster to read a specific stream, compared with the slow CloudWatch UX in AWS Console, and having to keep clicking the "Load more" link to see the whole stream.

I can do saw groups and saw streams <group name> to find my stream.

But how do I get a specific stream, once I have the stream name?

I tried various permutations of saw get, e.g. saw get <group>/<stream> but couldn't find an approach that worked.

saw get <group> --start -4h works, but it means multiple streams are mixed together. I want to only see a specific stream at a time.

yellowtailfan commented 3 years ago

OK I figured it out. Maybe this will help someone else. The problem was the stream is for a Batch job that already completed, so I needed to specify a time range that overlaps with the stream. The saw default is to only watch for new lines in the stream.

Here's what worked:

saw get <group> --prefix <stream> --start -4h

It would be nice if there was a shortcut to just get the whole stream. I suppose I could put a very old start time in.