Skip to content
New issue

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

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

Open
punisherVX opened this issue Sep 23, 2020 · 3 comments

Comments

@punisherVX
Copy link

punisherVX commented Sep 23, 2020

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.

@ghost
Copy link

ghost commented Nov 3, 2020

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

@punisherVX
Copy link
Author

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

@ansidorov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants