0

I am following the below document to connect to Cloudwatch logs to ELK.

https://medium.com/@sohit_kumar/streaming-aws-cloudwatch-logs-to-your-own-elk-logging-solution-2bbd32f25100

I get a "expected an indented block" syntax error in python for this line.

try: logs = awslogs_handler(s, event)

Can someone help me figure this out? Not sure what im missing.

Thanks!

4
  • 1
    The entire example has incorrect indentation, not only the try line. Commented Aug 21, 2020 at 10:27
  • Thats true, when i moved to correcting try, i see issue with the next for statements. Is there a way to correct this? @Marcin Commented Aug 21, 2020 at 10:28
  • It has to be manually all fixed. I'm not aware of any automated way to fix that. Commented Aug 21, 2020 at 10:40
  • Got it thank you! :) Commented Aug 21, 2020 at 10:41

1 Answer 1

1

You need to use something like this:

try:
    logs = awslogs_handler(s, event)

An indent block(contains four whitespaces) are required. You can read more here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.