ilanddev/syslogng_kafka

Error parsing python, syntax error, unexpected '(' in /etc/syslog-ng/conf.d/kafka.conf

punisherVX opened this issue · 3 comments

Ubuntu 18.04
Syslog-ng 3.29 installed via pip3

I am using the kafka.conf destination configuration in these instructions: https://syslogng-kafka.readthedocs.io/en/latest/installation.html and getting the following error when running sudo syslog-ng -F:


Error parsing python, syntax error, unexpected '(' in /etc/syslog-ng/conf.d/kafka.conf:6:22-6:23:
1       destination syslog_to_kafka {
2           python(
3               class("syslogng_kafka.kafkadriver.KafkaDestination")
4                   on-error("fallback-to-string")
5                   options(
6----->                 hosts("localhost:9092,localhost:9182")
6----->                      ^
7                       topic("syslog")
8                       partition("10")
9                       msg_key("src_ip")
10                      programs("firewall,nat")

destination syslog_to_kafka {
11                      broker_version("0.8.2.1")

Included from /etc/syslog-ng/syslog-ng.conf:163:1-163:1:

I have tried cutting and pasting and also entering everything by hand to no avail.

same on Debian 10, but on Debian 9 it is working very well

same on Debian 10, but on Debian 9 it is working very well

I will try this on 16.04 and see what happens. Thanks @brokenrainbow

With python3 you need to use this format:

destination syslog_to_kafka {
  python(
    class("syslogng_kafka.kafkadriver.KafkaDestination")
      on-error("fallback-to-string")
      options(
        "hosts" "localhost:9092,localhost:9093"
        "topic" "security-eset"
      )
  );
};

blog post: https://www.syslog-ng.com/community/b/blog/posts/python-source-in-syslog-ng