Obtain nginx log after ELK
Elk obtains nginx log information through filebeat
Kibana-Infrastructure-View installation instructions-all-nginx logs
Download and install Filebeat
Curl-L-O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.1.1-darwin-x86_64.tar.gztar xzvf filebeat-7.1.1-darwin-x86_64.tar.gzcd filebeat-7.1.1-darwin-x86_64/
Edit configuration
Modify the filebeat.yml to set the connection information:
Output.elasticsearch: hosts: ["] # ip:9200 username:" elastic "# user password can not be entered password:"setup.kibana: host:"# ip:5601
Where is the user's password? the URL of Elasticsearch is the URL of Kibana. Elastic
Enable and configure the Nginx module
In the installation directory, run:
. / filebeat modules enable nginx vim / etc/filebeat/modules.d/nginx.yml
Modify the settings in the modules.d/nginx.yml file, remove comments and add nginx log path
Var.paths: ["/ var/log/nginx/access.log"] var.paths: ["/ var/log/nginx/error.log"]
Start Filebeat
The setup command loads the Kibana dashboard. If you have already set up the dashboard, ignore this command.
. / filebeat setup./filebeat-e
Firewall on exception or off
Finally, it is tested in kibana, and the nginx log information can be obtained if the test is successful.