In case anyone else comes across this issue, I had to add PYTHONPATH to the suders file, see here for more details, http://stackoverflow.com/questions/25387374/why-are-modules-in-pythonpath-no... Also the documentation at https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/sec... is old and doesn't reflect the current method signatures, in particular the init function now requires 2 arguments, this is shown in the example source https://github.com/balabit/syslog-ng/blob/master/modules/python/sngexample.p... Cheers, Wil On Sat, Feb 27, 2016 at 7:21 PM Scheidler, Balázs < balazs.scheidler@balabit.com> wrote:
Hmm. Maybe an exception happens during import? Clearly the import itself fails. On Feb 26, 2016 20:24, "Wil Koch" <wfkoch@gmail.com> wrote:
Hi All, I am following the tutorial below in an attempt to get Python support for destinations,
https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/sec...
I have built syslog-ng-3.7.2 from source and have it up and running on Ubuntu 14.04. I initially had a simple log for iptables logging to a file to confirm functionality. After I changed my conf to include a Python destination, I am receiving the following error when starting syslog-ng at the command line, [2016-02-26T12:15:48.874748] Error loading Python module; module='betterpythonexample', exception='exceptions.ImportError: No module named betterpythonexample' [2016-02-26T12:15:48.874775] Error looking Python driver class; driver='python_to_file#0', class='betterpythonexample.TextDestination', exception='None' [2016-02-26T12:15:48.874782] Error initializing message pipeline;
I have PYTHONPATH set to the directory where the script is, and I have confirmed the variable is working by importing the module in the python interpreter. Any suggestions for debugging would be much appreciated, I'm out of ideas.
Thank you, Wil
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq