Support Questions

Find answers, ask questions, and share your expertise

Flume Tutorial Error with Python Script

avatar
Contributor

I am working through this tutorial and I'm encountering the error shown below. I see that others have experienced it to from looking at the comments below the walk through. I believe I have successfully completed this tutorial before. Any ideas on how to resolve this?

[root@sandbox home]# python generate_logs.pyFile “generate_logs.py”, line 98return resultsSyntaxError: ‘return’ outside function
1 ACCEPTED SOLUTION

avatar
Master Guru

Just downloaded and ran the generate_logs file in the sandbox and it works fine for me. Are you sure you didn't modify the script somehow? Sometimes python is very sensitive to tab changes. Its easy for a return to suddenly be a couple characters more to the left or right and with that not in the function anymore.

View solution in original post

12 REPLIES 12

avatar
Master Guru

Seriously no idea. Last attempt here is my script: generate-logspy.zip

But I swear I just downloaded it from the url you added

avatar
Contributor

@Benjamin Leonhardi Me either. Just replaced my file with yours and receive the same error about line 98 which I would have received before commenting out the return statement on that line

avatar
Master Guru

A poltergeist? I don't have a line 98, neither in Macos nor in linux.