Python Forum

Full Version: Logstash - sending Logstash messages to another host in case of Failover in python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm currently using TCPLogstashHandler to send Logstash messages using TCP. The below code is used to add the TCPLogstashHandler to the root logger.

test_logger.addHandler(logstash.TCPLogstashHandler(host, port, version=1))

I am using the python-logstash library to use TCPLogstashHandler. I'm able to send logs by adding the handler. Also I'm not using Filebeat.
For reference:
https://github.com/vklochan/python-logst...xample1.py

what I need is:

In case of failover, I want to pass 3 hosts. How to pass 3 hosts and its respective port using customised LogstashHandler. so that if any one of the host fails, it will automatically pickup other host