当前位置:网站首页>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

边栏推荐
- 为什么我不推荐去SAP培训机构参加培训?
- Row lock analysis and deadlock
- wm_concat()和group_concat()函数
- 50 lines of code to crawl TOP500 books and import TXT documents
- System table SQLite of SQLite database_ master
- 成功解决之idea引用Lombok的@Slf4j后无法正常使用log
- NFTGameFi链游系统开发详解方案丨链游系统开发原理解析
- RSA concept explanation and tool recommendation - LMN
- 商品秒杀系统
- 50行代码爬取Top500图书导入TXT文档
猜你喜欢
随机推荐
properties文件乱码
Deep understanding of MySQL lock and transaction isolation level
How about opening a flush account? Is it safe? How to open a stock trading account
Numpy's Matplotlib
转:苹果CEO库克:伟大的想法来自不断拒绝接受现状
Let torch cuda. is_ Experience of available() changing from false to true
Comparing the size relationship between two objects turns out to be so fancy
vutils. make_ A little experience of grid () in relation to black and white images
行锁与隔离级别案例分析
ARM裸板调试之串口打印及栈初步分析
深度学习之Numpy篇
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
DVD-数字通用光盘
微服务架构
成功解决之Jenkins报错:The goal you specified requires a project to execute but there is no POM
Leetcode 238 product of arrays other than itself
System table SQLite of SQLite database_ master
Tag dynamic programming - preliminary knowledge for question brushing -2 0-1 knapsack theory foundation and two-dimensional array solution template
vuex中利用缓存解决刷新state数据丢失问题
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems









