filebeat6.2.2 forApache logs/MySQL logs/Nginx logs/Redis logs/System logs模块安装
1、Install Elasticsearch GeoIP anduser agent plugins
This module requires twoElasticsearch plugins that are not installed by default.
From the Elasticsearchinstallation folder, run:
bin/elasticsearch-plugin install ingest-geoip
bin/elasticsearch-plugin install ingest-user-agent
2、Download and install Filebeat
First time using Filebeat? Seethe Getting Started Guide.
curl -L -Ohttps://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.2-x86_64.rpm
sudo rpm -vi filebeat-6.2.2-x86_64.rpm
Lookingfor the 32 bits packages? See the Download page.
3、Edit the configuration
Modify /etc/filebeat/filebeat.yml
to set the connectioninformation:
output.elasticsearch:
hosts: ["<es_url>"]
username: "elastic"
password: "<password>"
setup.kibana:
host: "<kibana_url>"
Where <password> isthe password of the elastic user, <es_url> is the URLof Elasticsearch, and <kibana_url> is the URL of Kibana.
4、Enable and configure the nginx module
a、sudofilebeat modules enable nginx
Modify the settings inthe /etc/filebeat/modules.d/nginx.yml file.
b、sudofilebeat modules enable apache2
Modify the settings inthe /etc/filebeat/modules.d/apache2.yml file.
c、sudofilebeat modules enable mysql
Modifythe settings in the /etc/filebeat/modules.d/mysql.yml file.
d、sudofilebeat modules enable system
Modifythe settings in the /etc/filebeat/modules.d/system.yml file.
e、sudofilebeat modules enable redis
Modifythe settings in the /etc/filebeat/modules.d/redis.yml file.
5、Start Filebeat
The setup
command loads the Kibanadashboards. If the dashboards are already set up, omit this command.
filebeat setup
systemctl start filebeat.service