Skip to content

Instantly share code, notes, and snippets.

@laclaro
Last active March 30, 2020 15:23
Show Gist options
  • Save laclaro/a9ba8b6f1f1ed8f9de23d1383f71666c to your computer and use it in GitHub Desktop.
Save laclaro/a9ba8b6f1f1ed8f9de23d1383f71666c to your computer and use it in GitHub Desktop.
simple logging config file for privacyIDEA to send to logstash
# /etc/privacyidea/logging_logstash_simple.cfg
[handlers]
keys=logstash_async
[handler_logstash_async]
# https://python-logstash-async.readthedocs.io/en/latest/usage.html#usage-with-logging-file-config
class=logstash_async.handler.AsynchronousLogstashHandler
level=INFO
args=('%(host)s', %(port)s,'%(database_path)s')
host=192.168.56.150
port=5959
database_path=logstash_async_cache.sqlite
[loggers]
keys=privacyidea,audit
[logger_privacyidea]
handlers=logstash_async
qualname=privacyidea
level=DEBUG
[logger_audit]
handlers=logstash_async
qualname=pi-audit
level=DEBUG
# /etc/privacyidea/logging_logstash_simple.yml
handlers:
logstash_async:
class: logstash_async.handler.AsynchronousLogstashHandler
host: 192.168.56.150
port: 5959
database_path: 'logstash_async_cache.sqlite'
level: INFO
loggers:
privacyidea:
handlers:
- logstash_async
level: DEBUG
pi-audit:
handlers:
- logstash_async
level: DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment