Python Forum
Logstash - sending Logstash messages to another host in case of Failover in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logstash - sending Logstash messages to another host in case of Failover in python
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python automation: Sending clicks/keys to VMware virtual machine from host olips784 0 86 7 hours ago
Last Post: olips784
  I am sending messages using Python to Telegram, but I need to use WhatsApp for it Hendrikb 0 300 Apr-29-2025, 09:38 AM
Last Post: Hendrikb
  Sending a text from Python sawtooth500 2 1,332 Apr-14-2024, 01:56 PM
Last Post: sawtooth500
  What colon (:) in Python mean in this case? Yapwc 4 5,528 Dec-28-2022, 04:04 PM
Last Post: snippsat
  where to host my python script tomtom 1 1,875 Feb-09-2022, 06:45 AM
Last Post: ndc85430
  Switch case or match case? Frankduc 9 7,886 Jan-20-2022, 01:56 PM
Last Post: Frankduc
  Sending string commands from Python to a bluetooth device Rovelin 13 16,569 Aug-31-2021, 06:40 PM
Last Post: deanhystad
  Failing to connect to a host with WMI tester_V 6 6,350 Aug-10-2021, 06:25 PM
Last Post: tester_V
  Help: write 'case' with Python ICanIBB 2 2,620 Jan-27-2021, 09:39 PM
Last Post: Larz60+
  Sending Out Email via Python JoeDainton123 1 6,836 Aug-31-2020, 12:54 AM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020