当前位置:网站首页>Filebeat安装及使用
Filebeat安装及使用
2022-06-26 18:25:00 【cc_南柯一梦】
Filebeat是一个轻量级日志传输Agent,可以将指定日志转发到Logstash、Elasticsearch、Kafka、Redis等中。Filebeat占用资源少,而且安装配置也比较简单,支持目前各类主流OS及Docker平台。
一:Filebeat安装及使用
1、下载
官网地址:https://www.elastic.co/cn/downloads/past-releases#filebeat
2、安装
上传解压

3、进去filebeat目录创建一个配置文件
此时我们已最简单的配置进行验证


filebeat.inputs:
- type: stdin
enabled: true
setup.template.settings:
index.number_of_shards: 3
output.console:
pretty: true
enable: true 4、启动命令
./filebeat -e -c itcast.yml

5、验证
启动后输入hello回车,此时回看到输出json为处理后的日志数据

6、读取文件
1:修改- type: log
2:添加读取文件地址
paths:
- /home/cc/logs/*.log

3:启动查看此时已读取到文件内容

7、自定义字段
两种方式:
【1】:tags:["web"]
【2】:
fields:
from: cc

启动查看:

fields直接添加为添加到子节点:
添加命令:fields_under_root: true 则添加到根节点


8、输出到Elasticsearch
配置:
output.elasticsearch:
hosts: ["192.168.231.146"]

验证:
9、Module的使用
使用命令:./filebeat modules list 即可查看已经设置好的Model

启动命令:./filebeat modules enable nginx
禁用命令:./filebeat modules disable nginx
配置:进入到配置文件。进行配置


修改配置文件
原输入类型注释掉。配置modules

边栏推荐
- Summary of alter operation in SQL
- 带你解决哈希冲突,并实现一个简单hash表,
- Bayesian network explanation
- GDB installation
- Crawl Douban to read top250 and import it into SqList database (or excel table)
- 如何创建并强制使用索引
- [unity] use C in unity to execute external files, such as Exe or bat
- VCD-影音光碟
- Regular match same character
- The cross compilation environment appears So link file not found problem
猜你喜欢

Clion breakpoint single step debugging

最小生成树、最短路径、拓扑排序、关键路径

零时科技 | 智能合约安全系列文章之反编译篇

带你解决哈希冲突,并实现一个简单hash表,

RSA encryption and decryption details

Chinese (Simplified) language pack

Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems

wm_concat()和group_concat()函数

Deep understanding of MySQL lock and transaction isolation level

vutils. make_ A little experience of grid () in relation to black and white images
随机推荐
将字符串B插入字符串A,有多少种插入办法可以使新串是一个回文串
Determine whether a sequence is a stack pop-up sequence
ROS查询话题具体内容常用指令
微信小程序 自定义 弹框组件
Solidity - 合约继承子合约包含构造函数时报错 及 一个合约调用另一合约view函数收取gas费用
Temporarily turn off MySQL cache
图像二值化处理
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
ROS的发布消息Publishers和订阅消息Subscribers
DVD digital universal disc
Decision tree and random forest
几种常见的UML关系图汇总
sql中的几种删除操作
xlua获取ugui的button注册click事件
Deep learning: numpy
Data Encryption Standard DES security
字符串String转换为jsonArray并解析
Several delete operations in SQL
JS cast
RSA concept explanation and tool recommendation - LMN