<div dir="ltr"><div><div><div>In case anyone else comes across this issue, I had to add PYTHONPATH to the suders file, see here for more details,<br><a href="http://stackoverflow.com/questions/25387374/why-are-modules-in-pythonpath-not-found-when-the-containing-directory-is-part-of">http://stackoverflow.com/questions/25387374/why-are-modules-in-pythonpath-not-found-when-the-containing-directory-is-part-of</a><br><br></div>Also the documentation at <a href="https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/section_1.html">https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/section_1.html</a> is old and doesn&#39;t reflect the current method signatures, in particular the init function now requires 2 arguments, this is shown in the example source <a href="https://github.com/balabit/syslog-ng/blob/master/modules/python/sngexample.py">https://github.com/balabit/syslog-ng/blob/master/modules/python/sngexample.py</a><br><br></div>Cheers,<br></div>Wil<br></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Feb 27, 2016 at 7:21 PM Scheidler, Balázs &lt;<a href="mailto:balazs.scheidler@balabit.com">balazs.scheidler@balabit.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hmm. Maybe an exception  happens during import? Clearly the import itself fails.</p>
<div class="gmail_quote"></div><div class="gmail_quote">On Feb 26, 2016 20:24, &quot;Wil Koch&quot; &lt;<a href="mailto:wfkoch@gmail.com" target="_blank">wfkoch@gmail.com</a>&gt; wrote:<br type="attribution"></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All,<br>I am following the tutorial below in an attempt to get Python support for destinations,<br><br><a href="https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/section_1.html" target="_blank">https://syslog-ng.gitbooks.io/getting-started/content/chapters/chapter_5/section_1.html</a><br><br>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,<br> [2016-02-26T12:15:<a href="tel:48.874748" value="+3648874748" target="_blank">48.874748</a>] Error loading Python module; module=&#39;betterpythonexample&#39;, exception=&#39;exceptions.ImportError: No module named betterpythonexample&#39;<br>[2016-02-26T12:15:<a href="tel:48.874775" value="+3648874775" target="_blank">48.874775</a>] Error looking Python driver class; driver=&#39;python_to_file#0&#39;, class=&#39;betterpythonexample.TextDestination&#39;, exception=&#39;None&#39;<br>[2016-02-26T12:15:<a href="tel:48.874782" value="+3648874782" target="_blank">48.874782</a>] Error initializing message pipeline;<br><br>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&#39;m out of ideas.<br><br>Thank you,<br>Wil<br></div>
<br></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
<br></blockquote></div>
______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
</blockquote></div>