AWS lambda expected intended block error in Python

Tags: , ,

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

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.



You need to use something like this:

    logs = awslogs_handler(s, event)

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

Source: stackoverflow