AlisonGrey
AlisonGrey

Reputation: 507

AWS lambda expected intended block error in Python

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!

Upvotes: 0

Views: 99

Answers (1)

CK__
CK__

Reputation: 1311

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

Upvotes: 1

Related Questions