napalm-automation / napalm-logs

Cross-vendor normalisation for network syslog messages, following the OpenConfig and IETF YANG models
https://napalm-logs.readthedocs.io/en/latest/
Apache License 2.0
140 stars 43 forks source link

Question about the buffer setting #343

Open dpizzle opened 3 years ago

dpizzle commented 3 years ago

Hi, I am trying to suppress duplicate syslog messages with the buffer setting. I am struggling to enable the setting from the documentation. When I set it at the top level of the /etc/napalm/log file, I see the corresponding error in the log file.

/ # napalm-logs --version
napalm-logs 0.9.0

From - /etc/napalm/log

publisher:
  - zmq:
      error_whitelist:
        - OSPF_NEIGHBOR_DOWN
        - OSPF_NEIGHBOR_UP
disable_security: True
buffer:
  mem:
    expire_time: 30
napalm_logs_1  |   cfg = yaml.load(fstream)
napalm_logs_1  | Process Process-7:
napalm_logs_1  | Traceback (most recent call last):
napalm_logs_1  |   File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
napalm_logs_1  |     self.run()
napalm_logs_1  |   File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
napalm_logs_1  |     self._target(*self._args, **self._kwargs)
napalm_logs_1  |   File "/usr/lib/python3.6/site-packages/napalm_logs/server.py", line 296, in start
napalm_logs_1  |     message_key = base64.b64encode(message)
napalm_logs_1  |   File "/usr/lib/python3.6/base64.py", line 58, in b64encode
napalm_logs_1  |     encoded = binascii.b2a_base64(s, newline=False)
napalm_logs_1  | TypeError: a bytes-like object is required, not 'str'
mirceaulinic commented 3 years ago

Hmm yeah, that's probably a bug.