当前位置:网站首页>logstash丢弃没有精准匹配到文件名的日志数据
logstash丢弃没有精准匹配到文件名的日志数据
2022-06-25 22:14:00 【zhangphil】
logstash丢弃没有精准匹配到文件名的日志数据
一种场景,如果确定需要精准采集这一文件 f:\x\data\2022-05-27-231259\my.txt 里面的数据,不是这样形式的 data\yyyy-mm-dd-hhmmss\my.txt 文件,一律不采集日志数据。
filter {
grok {
match => {
"[log][file][path]" => "/data/%{YEAR}-%{MONTHNUM}-%{MONTHDAY}-%{HOUR}%{MINUTE}%{SECOND}/my.txt"
}
tag_on_failure => [ "tag_failure" ]
}
if "tag_failure" in [tags]{
drop{
#丢弃
}
}
}首先需要按照log.file.path的文件全路径匹配,匹配失败,增加一个 tag_failure标签,在if逻辑判断中如果检测到这个tag标签,就drop,这个drop将丢弃到采集的这行日志。
边栏推荐
- Common problems encountered when creating and publishing packages using NPM
- 14.1.1 promethues monitoring, four data types metrics, pushgateway
- Keil compilation run error, missing error: # 5: # includecore_ cm3.h_ Old bear passing by_ Sina blog
- 【微信公众号H5】 生成带参数进入公众号关注页的二维码 监听用户关注公众号事件 自定义菜单栏 (服务端)
- huibian
- 10.2.3、Kylin_kylin的使用,维度必选
- smt贴片加工行业常见术语及知识汇总
- Bit Compressor [蓝桥杯题目训练]
- SMT贴片加工pcba立碑现象的原因和解决方法
- Literature research (III): overview of data-driven building energy consumption prediction models
猜你喜欢

手工制作 pl-2303hx 的USB轉TTL電平串口的電路_過路老熊_新浪博客

JS to input the start time and end time, output the number of seasons, and print the corresponding month and year

DNS复习

文献调研(四):基于case-based reasoning、ANN、PCA的建筑小时用电量预测

Circuit de fabrication manuelle d'un port série de niveau USB à TTL pour PL - 2303hx Old bear passing Sina blog

迅为RK3568开发板使用RKNN-Toolkit-lite2运行测试程序

10.4.1、数据中台

86.(cesium篇)cesium叠加面接收阴影效果(gltf模型)

Thrift getting started

DHCP review
随机推荐
Common knowledge points in JS
6. common instructions (upper) v-cloak, v-once, v-pre
Smt贴片机工作流程
网络连接验证
MySQL master-slave replication
Multi-Instance Redo Apply
Hand made pl-2303hx USB to TTL level serial port circuit_ Old bear passing by_ Sina blog
smt贴片加工行业常见术语及知识汇总
Shredding Company poj 1416
Mysql5.7 is in the configuration file my Ini[mysqld] cannot be started after adding skip grant tables
正则表达式介绍及一些语法
Idea common shortcut keys
10.4.1、数据中台
记录一些cf的题
Rocket之消息存储
小红书微服务框架及治理等云原生业务架构演进案例
手工制作 pl-2303hx 的USB轉TTL電平串口的電路_過路老熊_新浪博客
被新冠后遗症困住15个月后,斯坦福学霸被迫缺席毕业典礼,现仍需每天卧床16小时:我本该享受20岁的人生啊...
huibian
ORA-01153 :激活了不兼容的介质恢复