Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Filebeat
Filebeat dient zur Weiterleitung der von Syslog aufgenommenen Logs an z.B. Logstash.
Es prüft ein oder mehrere Quellen auf Änderungen und leitet diese dann weiter.
Filebeat kommuniziert über den Port 5044 mit Logstash.
Installation
Einfach das deb-Paket von elastic.co herunterladen und installieren
dpkg -i filebeat-6.2.1-amd64.deb
Unter /usr/share/filebeat/
liegen die installieren Dateien.
Konfigurieren
Die Konfigurationsdateien liegen unter /etc/filebeat/
.
Die Datei filebeat.yml
ist die Hauptkonfigurationsdatei.
Hier eine initiale Konfiguration zur Kommunikation mit dem Elasticstack.
#Filebeat modules filebeat.config.modules: # Glob pattern for configuration loading path: ${path.config}/modules.d/*.yml # Set to true to enable config reloading reload.enabled: false # Period on which files under path should be checked for changes #reload.period: 10s #==================== Elasticsearch template setting ========================== setup.template.settings: index.number_of_shards: 3 setup.kibana: host: "<HOSTNAME_DES_KIBANA_SERVERS>:5601" ## Logstashstuff output.logstash: # The Logstash hosts hosts: ["<HOSTNAME_DES_LOGSTASH_SERVERS>:5044"] ## Loggingstuff logging.level: warning logging.to_files: true logging.to_syslog: false logging.files: path: /var/log/filebeat name: filebeat-logstash.log keepfiles: 7 permissions: 0644 ## Prospectors filebeat.prospectors: - type: log #enabled: false paths: - /var/log/syslogs/usv*.log fields: device: usv - type: log #enabled: false paths: - /var/log/syslogs/hpprocurve*.log fields: device: hpswitch
Konfiguration testen
filebeat test [config|putput] --path.config /etc/filebeat/ [--help]
Debugging
Um auf der Konsole zu sehen was gerade bei Filebeat passiert, folgendes ausführen:
systemctl stop filebeat.service filebeat -e -d "publish"