We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got python exception when I wanted to use msg.MSG from python script with python3 interpreter
Reproduction:
class DummyPythonDest(object): def init(self, options): return True def send(self, msg): print("send: %s\n" % msg.MSG) return True
@version: 3.9 source s_net {tcp( ip("127.0.0.1") port(6666) );}; destination d_python { python( class("sngexample.DummyPythonDest") ); }; log { source(s_net); destination(d_python); };
[2017-03-06T15:08:32.136246] Incoming log entry; line='<38>2017-03-06T15:08:32 localhost prg00000[1234]: seq: 0000000000, thread: 0000, runid: 1488809312, stamp: 2017-03-06T15:08:32 PADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADDPADD' [2017-03-06T15:08:32.136638] EOF occurred while reading; fd='15' [2017-03-06T15:08:32.141016] Syslog connection closed; fd='15', client='AF_INET(127.0.0.1:52600)', local='AF_INET(127.0.0.1:6666)' [2017-03-06T15:08:32.141118] Closing log transport fd; fd='15' Traceback (most recent call last): File "/home/micek/micek_work/micek_syslog_ng_python_scripts/sngexample.py", line 8, in send print(msg.MSG) SystemError: error return without exception set [2017-03-06T15:08:32.211917] g_strlcpy: assertion 'src != NULL' failed TypeError: expected bytes, str found [2017-03-06T15:08:32.212136] Exception while calling a Python function; module='d_python#0', script='sngexample.DummyPythonDest', function='P\xa8\x0e\xd0r', exception='None'
The text was updated successfully, but these errors were encountered:
Instead of print("send: %s\n" % msg.MSG) this needs to be used: print("send: %s\n" % msg["MESSAGE"])
print("send: %s\n" % msg.MSG)
print("send: %s\n" % msg["MESSAGE"])
Sorry, something went wrong.
From #1371 only msg['MSG'] form is supported.
msg['MSG']
furiel
No branches or pull requests
I got python exception when I wanted to use msg.MSG from python script with python3 interpreter
Reproduction:
The text was updated successfully, but these errors were encountered: