J'ai un filebeat (opérationnel) qui envoie des logs vers logstash puis elasticsearch.
Je voudrai activer le module haproxy de filebeat pour qu'il envoie les logs haproxy vers elasticsearch mais quand je lance la commande : filebeat setup -e
J'ai l'erreur suivante :
Exiting: error unpacking config data: more than one namespace configured accessing 'output' (source:'/etc/filebeat/filebeat.yml')
J'ai vu qu'on peut pas avoir plusieurs outputs avec filebeat.
Comment faire dans ce cas présent ?
Mon objectif est de profiter des dashboards haproxy et des mapping déjà présent dans le module.
Ci-dessous le contenu de mon fichier filebeat.yml :
#================================ Outputs =====================================
# Configure what output to use when sending the data collected by the beat.
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["http://xxx.xxx.xx.xx:9200"]
#----------------------------- Logstash output --------------------------------
output.logstash:
# The Logstash hosts
hosts: ["xxx.xxx.xx.xx:5044"]
Will switch to english to prevent some misunderstandings: Beats only supports 1 output enabled at the same time. Can you comment out either the logstash or the elasticsearch output and see if it works? Strangely I would expect that a different error is shown to you.
When I comment elasticsearch output it works the data is well inserted into elasticearch via logstash and I watch my data in kibana.
At first I used only logstash which works perfectly but I uncommented elasticearch output to be able to use the haproxy module.
[root@tup-perf4-rmq1 ~]# filebeat modules list
Enabled:
haproxy
filebeat is started :
[root@tup-perf4-rmq1 ~]# service filebeat start
Starting filebeat (via systemctl): [ OK ]
```
[root@tup-perf4-rmq1 ~]# sudo journalctl -u filebeat
-- Logs begin at sam. 2019-04-27 05:53:24 CEST, end at lun. 2019-04-29 17:50:20 CEST. --
avril 29 17:46:50 tup-perf4-rmq1 systemd[1]: Stopping Filebeat sends log files to Logstash or directly to Elasticsearch....
avril 29 17:46:50 tup-perf4-rmq1 systemd[1]: Stopped Filebeat sends log files to Logstash or directly to Elasticsearch..
avril 29 17:50:01 tup-perf4-rmq1 systemd[1]: Started Filebeat sends log files to Logstash or directly to Elasticsearch..
- module: haproxy
# All logs
log:
enabled: true
# Set which input to use between syslog (default) or file.
var.input: "file"
# Set custom paths for the log files. If left empty,
# Filebeat will choose the paths depending on your OS.
var.paths: ["/root/tools/log_haproxy_for_filebeat.log"]
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.