日志分析 第四章 安装filebeat

本文详细介绍如何在后端主机上安装配置Filebeat 1.2.3版本,实现对Nginx及PHP错误日志的实时监控与收集,并通过Logstash将数据发送到Elasticsearch。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在进行前面准备之后可以开始安装了,我们的安装顺序是filebeat--->logstash--->elasticsearch

filebeat安装很简单,先下载filebeat,这里我们使用1.2.3版本。

filebeat官网:https://www.elastic.co/products/beats/filebeat

安装filebeat(每一台后端主机都要安装)

# tar xf filebeat-1.2.3-x86_64.tar.gz -C /usr/local/app/
# ln -sv /usr/local/app/filebeat-1.2.3-x86_64 /usr/local/filebeat
# cd /usr/local/filebeat/

创建配置文件nginx-php.yml

filebeat:
  prospectors:
    -
      paths:
        - /data/logs/nginx/access_all.log
      document_type: 51-nginxaccesslog
      input_type: log
      tail_files: true
      multiline:
        negate: true
        match: after
    -
      paths:
        - /data/logs/nginx/error.log
      document_type: 51-nginxerrorlog
      input_type: log
      tail_files: true
      multiline:
        negate: true
        match: after
    -
      paths:
        - /data/logs/php/php_error.log
      document_type: 51-phperrorlog
      input_type: log
      tail_files: true
      multiline:
        negate: true
        match: after
output:
  logstash:
    hosts: ["10.80.2.181:5048"]
shipper:
logging:
  files:

 

转载于:https://www.cnblogs.com/xiaoming279/p/6112715.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值