-
Notifications
You must be signed in to change notification settings - Fork 2
LogWatcher Plugins
LogWatcher supports very simple LinePlugins. The plugins can modify the log lines, compute complex metrics, or even send some or all of the lines to a separate log file or other system (kafka). Note that lines excluded by the exclude filter are not sent to plugins. LinePlugins are standardized classes.
Each LinePlugin:
- The file name should be ${class_name}.py
- The class must implement these methods: init(debug=False, config={}) process_line(line) get_metrics() finish()
Each time a line is processed by LogWatcher, it will be sent to the process_line() of each configured LinePlugin before LogWatcher continues processing. The plugin must return the line to LogWatcher. This allows the plugin to modify the line before further processing.
When it is time for LogWatcher to send metrics to gmond/graphite, it will call each plugin's get_metrics() method, allowing the plugin to add its own metrics.
The finish() method is called before LogWatcher quits, and gives the plugins a chance to clean themselves up (i.e., send an incomplete batch of messages to kafka).
Kafka - Send Logs to a Kafka Topic