salt icon indicating copy to clipboard operation
salt copied to clipboard

salt.engines.logstash not loading

Open mbom2004 opened this issue 10 years ago • 8 comments

We are trying to use the Salt Engine for Logstash to send all information from the Salt event bus to our Logstash instance. I can't get the engine to load successfully. Any help would be much appreciated.

Salt Master config: master.txt

Debug Logs: /var/log/salt/master debug.txt

Salt-Master Version Report saltmasterversion.txt

Salt-Minion Version Report saltminionversion.txt

mbom2004 avatar Jul 08 '16 15:07 mbom2004

@mbom2004 what version of python-logstash do you have installed?

I'm not seeing this issue with python-logstash (0.4.6)

Also I determined this by running python -c "import logstash; logstash.LogstashHandler('localhost', 8080, version=1)" and I did not see the no attribute error.

Ch3LL avatar Jul 08 '16 17:07 Ch3LL

Thanks, I missed installing python-logstash but now have installed version 0.4.6. However now I'm getting the attached error: saltmaster

mbom2004 avatar Jul 08 '16 18:07 mbom2004

Just wanted to check to see if anybody has been able to reproduce the above error. The engine seems to load, however when something appears in the event bus we get the error "Error: 'str' object does not support item assignment".

mbom2004 avatar Jul 19 '16 19:07 mbom2004

We were able to get the issue resolved. It looks like there is a problem with the logstash.py file. We changed the logstash.py at the end of the file to match below:

ls fix

mbom2004 avatar Jul 21 '16 10:07 mbom2004

@Ch3LL @mbom2004 I was able to reproduce the exact error that you got with the following versions :

python-logstash : 0.46

salt --versions-report :

Salt

Version: Salt: 2016.3.0-n/a-3ef2ab6

Dependency Versions: cffi: 1.7.0 cherrypy: 3.2.2 dateutil: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.7.2 libgit2: 0.22.2 libnacl: Not Installed M2Crypto: 0.21.1 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.3.0 mysql-python: Not Installed pycparser: 2.14 pycrypto: 2.6.1 pygit2: 0.22.1 Python: 2.7.6 (default, Jun 22 2015, 17:58:13) python-gnupg: Not Installed PyYAML: 3.10 PyZMQ: 14.0.1 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.4.1 ZMQ: 4.0.4

System Versions: dist: Ubuntu 14.04 trusty machine: x86_64 release: 4.2.0-27-generic system: Linux version: Ubuntu 14.04 trusty

dcovello avatar Aug 24 '16 21:08 dcovello

Have the same problem - this should be reopened:

root@main:~# salt --versions
Salt Version:
           Salt: 2016.11.1
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: Ubuntu 16.04 xenial
        machine: x86_64
        release: 4.4.0-57-generic
         system: Linux
        version: Ubuntu 16.04 xenial
 

root@main:~# pip show python-logstash
---
Metadata-Version: 2.0
Name: python-logstash
Version: 0.4.6
Summary: Python logging handler for Logstash.
Home-page: https://github.com/vklochan/python-logstash
Author: Volodymyr Klochan
Author-email: [email protected]
License: UNKNOWN
Location: /usr/local/lib/python2.7/dist-packages
Requires: 

davidkarlsen avatar Dec 23 '16 09:12 davidkarlsen

Reopening. @mbom2004 would you mind submitting that as a PR.

Also can anyone confirm that @mbom2004 's fix also resolves their issue?

Ch3LL avatar Jan 25 '17 16:01 Ch3LL

When we upgraded from 2016.3.1 to 2016.11.1 the Logtash Engine had the same issue as above. After putting the fix in the logtash.py file the engine now works again.

mbom2004 avatar Jan 25 '17 18:01 mbom2004