当前位置:网站首页>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将丢弃到采集的这行日志。
边栏推荐
- Simulation connection between WinCC and STEP7_ Old bear passing by_ Sina blog
- smt贴片加工行业常见术语及知识汇总
- Number array de duplication in JS
- Reading notes on how to connect the network - hubs, routers and routers (III)
- Literature research (IV): Hourly building power consumption prediction based on case-based reasoning, Ann and PCA
- Hand made pl-2303hx USB to TTL level serial port circuit_ Old bear passing by_ Sina blog
- farsync 简易测试
- 19c安装psu 19.12
- linux安装redis
- Oracle writes a trigger that inserts a piece of data first and updates a field in the data
猜你喜欢

Recherche documentaire (3): examen des modèles de prévision de la consommation d'énergie des bâtiments fondés sur les données

7. common instructions (Part 2): common operations of v-on, v-bind and V-model

Establishment of multiple background blocks in botu software_ Old bear passing by_ Sina blog

Redis memory elimination mechanism

10.4.1 données intermédiaires
![Search rotation array ii[Abstract dichotomy exercise]](/img/db/3ea01cf1ad8446a7007891ef1d8e7f.png)
Search rotation array ii[Abstract dichotomy exercise]

正则表达式介绍及一些语法

Lazy people teach you to use kiwi fruit to lose 16 kg in a month_ Old bear passing by_ Sina blog

11.1.1、flink概述_flink概述

Notes on the method of passing items from the spider file to the pipeline in the case of a scratch crawler
随机推荐
解决线程并发安全问题
Lazy people teach you to use kiwi fruit to lose 16 kg in a month_ Old bear passing by_ Sina blog
Hand made pl-2303hx USB to TTL level serial port circuit_ Old bear passing by_ Sina blog
我的博客今天2岁167天了,我领取了先锋博主徽章_过路老熊_新浪博客
About the solution to prompt modulenotfounderror: no module named'pymongo 'when running the scratch project
详解synchronize关键字
Thrift入门学习
Notes on the method of passing items from the spider file to the pipeline in the case of a scratch crawler
Smt贴片机保养与维护要点
[wechat official account H5] generates a QR code with parameters to enter the official account attention page to listen to user-defined menu bar for official account events (server)
About Simple Data Visualization
MongoDB的一些基础用法
Recommended system design
ASA如何配置端口映射及PAT
oracle RAC 集群无法启动
anchor free dection简介
JS to input the start time and end time, output the number of seasons, and print the corresponding month and year
文献调研(二):基于短期能源预测的建筑节能性能定量评估
tensorrt pb转uff问题
Topic36——53. Maximum subarray and