当前位置:网站首页>filebeat、logstash配置安装
filebeat、logstash配置安装
2022-04-23 19:26:00 【hy_208】
1.下载安装包
https://www.elastic.co/cn/downloads/past-releases/filebeat-7-6-1
https://www.elastic.co/cn/downloads/past-releases/logstash-7-6-1
2.logstash配置文件
在logstash config目录下新建logstash.conf文件
logstash.conf配置如下:
input {
beats {
port => 5044
}
}
filter {
grok {
match => {
"message" => "%{TIMESTAMP_ISO8601:timestamp}\s*\[%{DATA:jetty}\]\s*%{LOGLEVEL:log_level}\s*%{NUMBER:number}\s*\TID:%{DATA:TID}\s*\---\s*\[%{DATA:thread}\]\s*(?m)(?<msg>.*|\s)"
}
}
mutate {
enable_metric => "false"
remove_field => ["message", "log", "tags", "input", "agent", "host", "ecs", "@version"]
}
date {
match => ["date","dd/MMM/yyyy:HH:mm:ss Z","yyyy-MM-dd HH:mm:ss"]
target => "date"
}
}
output {
elasticsearch {
hosts => ["12.0.0.1:9200"]
index => "web_log_%{+YYYY-MM}"
}
}
2022-04-21 08:48:20.277 [wkb-api-biz] INFO 3389 TID:760669fd04d54b0188f4ac533499b57f.116.16505021002761001 --- [XNIO-1 task-1] a.LoginUserHandlerMethodArgumentResolver
grok正则表达式对应自己的日志文件:
%{TIMESTAMP_ISO8601:timestamp}\s*\[%{DATA:jetty}\]\s*%{LOGLEVEL:log_level}\s*%{NUMBER:number}\s*\TID:%{DATA:TID}\s*\---\s*\[%{DATA:thread}\]\s*(?m)(?<msg>.*|\s)
3.进入logstash 按照目录
bin/logstash -f config/logstash.conf --config.reload.automatic &
3.filebeat配置文件
在filebeat目录下新建filebeat.yml、input-jetty.yml两个文件
filebeat.yml配置如下:
filebeat.config:
inputs:
enabled: true
path: input-jetty.yml
reload.enabled: true
reload.period: 10s
output.logstash:
enabled: true
hosts: ["127.0.0.1:5044"]
escape_html: true
index: 'wkb-jetty'
logging.level: info
logging.to_files: true
logging.files:
path: /var/log/filebeat
name: filebeat.log
rotateeverybytes: 104857600
keepfiles: 7
permissions: 0644
input-jetty.yml配置如下
- type: log
enabled: true
tags: ["jetty"]
paths:
- /data/log/jetty/*jetty-custom.log
multiline.pattern: '^\[[0-9]{4}-[0-9]{2}-[0-9]{2}'
multiline.negate: true
multiline.match: after
4. 启动filebeat
./filebeat -e -c filebeat.yml
版权声明
本文为[hy_208]所创,转载请带上原文链接,感谢
https://blog.csdn.net/hy_208/article/details/124314103
边栏推荐
- C1000k TCP connection upper limit test 1
- Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
- 什么是消息队列
- The usage of slice and the difference between slice and array
- ArcGIS JS API dojoconfig configuration
- ArcMap publishing slicing service
- Thoughts on the optimization of examination papers in the examination system
- 命令-sudo
- MFCC: Mel频率倒谱系数计算感知频率和实际频率转换
- MySQL syntax collation (4)
猜你喜欢
MFCC: Mel频率倒谱系数计算感知频率和实际频率转换
命令-sudo
MySQL syntax collation (5) -- functions, stored procedures and triggers
Decompile and get the source code of any wechat applet - just read this (latest)
Build intelligent garbage classification applet based on Zero
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
First experience of using fluent canvas
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
Common SQL commands
随机推荐
@MapperScan与@Mapper
On the forced conversion of C language pointer
All table queries and comment description queries of SQL Server
【h264】libvlc 老版本的 hevc h264 解析,帧率设定
SQL server requires to query the information of all employees with surname 'Wang'
Zero base to build profit taking away CPS platform official account
Main differences between go and PHP
Translation of audio signal processing and coding: Preface
Openharmony open source developer growth plan, looking for new open source forces that change the world!
Transaction processing of SQL Server database
SSDB Foundation
MySQL syntax collation
How to select the third-party package of golang
Gossip: on greed
JS controls the file type and size when uploading files
The platinum library cannot search the debug process records of some projection devices
Grafana 分享带可变参数的链接
White screen processing method of fulter startup page
Tencent cloud GPU best practices - remote development training using jupyter pycharm
UML类图几种关系的总结