Filter fluent位上的grep过滤器上的排除模式似乎不起作用
我试图过滤掉一些从尾部输入到流畅位的记录。但这似乎不起作用。从日志文件中,我需要从键值为“log”的所有记录中排除 1) 有一个或多个数字后跟空格的记录 2) 行中任意位置具有“系列”值的记录 3) 行中任意位置的值为“Transact Time”的记录 它们可能是相同或不同的记录Filter fluent位上的grep过滤器上的排除模式似乎不起作用,filter,grep,fluent-bit,Filter,Grep,Fluent Bit,我试图过滤掉一些从尾部输入到流畅位的记录。但这似乎不起作用。从日志文件中,我需要从键值为“log”的所有记录中排除 1) 有一个或多个数字后跟空格的记录 2) 行中任意位置具有“系列”值的记录 3) 行中任意位置的值为“Transact Time”的记录 它们可能是相同或不同的记录 [INPUT] Name tail Path /mnt/volume_nyc3_03/xenfix*.out Tag genfix D
[INPUT]
Name tail
Path /mnt/volume_nyc3_03/xenfix*.out
Tag genfix
DB /mnt/volume_nyc3_03/ggantel-gf.db
[FILTER]
Name grep
Match *
Exclude log ^[0-9]*\
Exclude log *Series*
Exclude log *transacttime*
[OUTPUT]
Name pulsar
Match *
Host somerandom-id.us-east-1.elb.amazonaws.com
Port 6650
Topic persistent://public/default/genfixlogs
[OUTPUT]
Name stdout
Match genfix
这不会从输出中排除任何记录,如下所示
{"log":"0 1"}
----- got message -----
{"log":"2019-09-17 21:25:08.636465 Series([], Name: transacttime, dtype: datetime64[ns])"}
----- got message -----
{"log":"2019-09-17 21:25:08.633038 Series([], Name: transacttime, dtype: datetime64[ns])"}
----- got message -----
{"log":"2019-09-17 21:25:08.680237 Series([], Name: transacttime, dtype: datetime64[ns])"}
----- got message -----
{"log":"2019-09-17 21:25:08.890903 Series([], Name: transacttime, dtype: datetime64[ns])"}
在使用正则表达式时,需要将//括起来 下面是一个例子
[FILTER]
Name grep
Match *
Exclude log /^[0-9]*/
Exclude log /.*Series.*/
Exclude log /.*transacttime.*/