简体   繁体   中英

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM