0

Im writing an bash script to help the logging of our system running at AWS.

Simplified version of the command it runs in the end is aws logs tail | grep "term". Everything works fine but when I'm closing the log stream with ctrl + c, i get the following error:

Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

Can i prevent that from happening, or is it something that should be caught in the aws logs script?

flsjk
  • 1

1 Answers1

0

It is a misfeature in Python which aws is expected to handle. However, if you simply want the error to not be shown, you can do this:

 aws logs tail | tee -p /dev/null | grep "term"
hackerb9
  • 1,545
  • 13
  • 14