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

Filebeat nginx log processing configuration

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. 7.4.0 enable module

. / filebeat modules list. / filebeat modules enable nginx. / filebeat modules list

2. Modify the modules.d/nginx.yml to add the corresponding address of the log

[elasticsearch@es1 filebeat-7.4.0-linux-x86_64] $cat modules.d/nginx.yml # Module: nginx# Docs: https://www.elastic.co/guide/en/beats/filebeat/7.4/filebeat-module-nginx.html- module: nginx# Access logs access: enabled: true # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. Var.paths: ["/ usr/local/nginx/logs/access.log*"] # Error logs error: enabled: true # Set custom paths for the log files. If left empty, # Filebeat will choose the paths depending on your OS. Var.paths: ["/ usr/local/nginx/logs/error.log"]

3. Configure filebeat configuration file

[elasticsearch@es1 filebeat-7.4.0-linux-x86_64] $cat nginx-m.yml filebeat.inputs:#- type: log# enabled: true# paths:#-/ usr/local/nginx/logs/*.log# tags: ["nginx"] setup.template.settings: index.number_of_shards: 2output.elasticsearch: # Array of hosts to connect to Hosts: ["192.168.56.101 path.config 9200"] filebeat.config.modules: path: ${path.config} / modules.d/*.yml reload.enabled: false [elasticsearch@es1 filebeat-7.4.0-linux-x86_64] $

4. Start

. / filebeat-e-c nginx-m.yml

5. Access and observe data

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

Database

Wechat

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

12
Report