linux
----------------
1. 下载
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.1-linux-x86_64.tar.g
2. 安装
tar xf filebeat-5.5.1-linux-x86_64.tar.gz
mkdir /home/elk
mv filebeat-5.5.1-linux-x86_64  /home/elk/filebeat
3. 配置文件    
配置文件:cat /home/elk/filebeat/filebeat.yml
    filebeat.prospectors:
    -
      fields: {log_type: "web-proxy-nginx-access"}
      paths:
        - /data/logs/nginx/access/www2.access.log
    -
      fields: {log_type: "web-proxy-nginx-error"}
      paths:
        - /data/logs/nginx/error/www2.error.log

output.kafka:
  hosts: ["59.188.25.225:9092"]
  topic: 'web-proxy-nginx-log'
  partition.round_robin:
    reachable_only: false
  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

shipper:
  tags: ["web-proxy-nginx-filebeat"]

4.启动和关闭:
    启动:nohup /home/elk/filebeat/filebeat -e -c /home/elk/filebeat/filebeat.yml  &
    关闭:kill -9 `ps aux|grep filebeat|head -1|awk -F" " '{print $2}'`
    查看进程:ps aux |grep filebeat

window
-------------------
1. 下载
https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.1-windows-x86_64.zip
2. 解压到C:\Program Files\Filebeat
3. 添加服务
   以管理员允许powershell
   cd 'C:\Program Files\Filebeat'
   set-executionpolicy Unrestricted
   .\install-service-filebeat.ps1
   set-executionpolicy Restricted
4. 配置文件: filebeat.yml
    filebeat.prospectors:
    -
      fields: {log_type: "web-proxy-nginx-access"}
      paths:
        - D:\data\www\nginx-1.4.7\logs\web2.access.log
    -
      fields: {log_type: "web-proxy-nginx-error"}
      paths:
        - D:\data\www\nginx-1.4.7\logs\web2.error.log

output.kafka:
  hosts: ["59.188.25.2xx:9092"]
  topic: 'web-proxy-nginx-log'
  partition.round_robin:
    reachable_only: false
  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

shipper:
  tags: ["web-proxy-nginx-filebeat"]    
5. 启动
   power shell下执行:Start-Service filebeat

让filebeat重新全部读取日志
-------------------------------
filebeat会在data/registry中记录已经读取的日志,如果想要filebeat全部重新读取,删除data/registry文件,然后重启filebeat.

最新文章

  1. 微信支付开发(1) JS API支付
  2. rabbimq连接问题处理
  3. 解决JS加载速度慢
  4. ACM: 强化训练-海贼王之伟大航路-dfs-枝减
  5. IPFS搭建分布式文件系统 - 访问控制
  6. PE渲染引擎 一
  7. C#中Const和Readonly的区别
  8. redis操作
  9. Spring+Ibatis集成开发实例
  10. JavaScript解析机制
  11. (原)opencv直线拟合fitLine
  12. 把GIF背景变透明
  13. Python进阶---面向对象的程序设计思想
  14. 基于Docker的GoldenGate部署
  15. ActiveMA在CentOS7下的安装
  16. c# string 扩展方法
  17. MyDO
  18. 高可用web框架
  19. (9) go 时间日期
  20. 8、springboot之定时任务

热门文章

  1. 使用java去对比2个带数学公式的字符串
  2. windows下使用RoboCopy命令进行文件夹增量备份
  3. 深入理解synchronize
  4. ctags+cscope替换sourceinsight
  5. 仅需几行代码 轻松实现ETH代币空投
  6. Android记事本10
  7. PTA 11-散列3 QQ帐户的申请与登陆 (25分)
  8. nginx教程全集汇总
  9. 用Spring注解的方式实现对某个网页的访问
  10. mac平台打造犀利的Android Studio开发环境