Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Obtain nginx log after ELK

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report