python-logstash not working

有些话、适合烂在心里 提交于 2021-01-27 12:46:02

问题


I have an elasticsearch cluster (ELK) and some nodes sending logs to the logstash using filebeat.
Lately I added a new application server, who is sending logs to my logstash using python-logstash.

My logstash input configuration looks something like this :

input {
   beats {
     type => beats
     port => 5044
   }
   udp {
     port => 5044
   }
}

My application server sends the logs successfully to the logstash. On my logstash machine I tried to run the following command:

tcpdump -nn | grep x.x.x.x

x.x.x.x is the ip of my application server.

My code is :

self.logger=logging.getLogger(logger_name)
self.logger.addHandler(logstash.UDPLogstashHandler(ELASTICSEARCH_LOGSTASH_SERVER, 5044, version=1, message_type='bla',fqdn=elastic_fqdn))

elastic_fqdn is the hostname of the hosted server.

I was able to see the packets, they looked fine (udp, port 5044), but I couldn't see any document in my kibana/elasticsearch.

Thanks for your help :)

来源:https://stackoverflow.com/questions/37658857/python-logstash-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!