CnOps 智能运维与可观测社区
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题
导航菜单
首页开源项目实践文章视频课程常见问答开发者工具STAROps 专题

CnOps 智能运维与可观测社区

愿景

CnOps 智能运维与可观测社区是一个以"智能运维与可观测"为核心的开放、包容、分享的技术社区,旨在聚集运维专家、开发者和爱好者,共同探讨、学习和分享可观测最佳实践与最新技术,与众多技术社区合作互动,共同探讨交叉领域的技术挑战,推动可观测领域的创新与进步。

内容社区

  • 实践文章
  • 视频课程
  • 开源项目
  • 常见问答
  • 开发者工具

友情链接

  • Prometheus
  • Grafana Lab
  • OpenTelemetry
  • LoongCollector

关注我们

阿里云云原生公众号阿里云云原生
阿里云可观测公众号阿里云可观测

Copyright © 2026 CnOps 社区. All rights reserved.

首页/开源项目/LoongCollector/数据筛选
文档目录
概览版本管理
什么是扩展插件BasicAuth鉴权协议解码/反序列化协议编码/序列化数据筛选请求熔断

LoongCollector

数据筛选

extgroupinfofilter 扩展插件,实现了 extensions.FlushInterceptor 接口,可以在 httpflusher 插件中引用,提供在向远端最终提交前筛选数据的能力。 Alpha 推荐版本:iLogtail v1.5.0 及以上 | 参数 | 类型 | 是否必选 | 说明 ...

GroupInfoFilter FlushInterceptor 扩展

简介

ext_groupinfo_filter 扩展插件,实现了 extensions.FlushInterceptor 接口,可以在 http_flusher 插件中引用,提供在向远端最终提交前筛选数据的能力。

版本

Alpha

版本说明

  • 推荐版本:iLogtail v1.5.0 及以上

配置参数

参数 类型 是否必选 说明
Tags Map<string,Condition> 否 需要过滤的GroupInfo.Tags的 key,value
Metas Map<string,Condition> 否 需要过滤的GroupInfo.Metadata的 key,value

其中,Condition 的字段结构如下:

字段 类型 是否必填 说明
Pattern string 是 匹配正则表达式
Reverse bool 否 是否反向选择,即选择不匹配 Pattern 的数据

样例

使用 metric_mock input 插件生成数据,并将采集结果以 custom_single 协议、json格式提交到 http://localhost:8086/write。

且在flusher处理时,仅选择GroupInfo的Tags中包含 tag1=tag1 的数据发送

enable: true
version: v2
inputs:
  - Type: metric_mock
    GroupMeta:
      meta1: meta1
    GroupTags:
      tag1: tag1
  - Type: metric_mock
    GroupMeta:
      meta2: meta2
    GroupTags:
      tag2: tag2
flushers:
  - Type: flusher_http
    RemoteURL: "http://localhost:8086/write"
    Convert:
      Protocol: custom_single
      Encoding: json
    FlushInterceptor: 
      Type: ext_groupinfo_filter
extensions:
  - Type: ext_groupinfo_filter
    Tags:
      tag1: 
        Pattern: tag1

使用命名扩展

当希望在同一个pipeline中使用多个扩展时,可一给同一类型的不同扩展实例附加一个命名,引用时可以通过full-name来引用特定的实例。

如下示例,通过将Type: ext_groupinfo_filter 改写为 Type: ext_groupinfo_filter/tag1,追加命名tag1,在 http_flusher插件中通过 ext_groupinfo_filter/tag1来引用。

enable: true
version: v2
inputs:
  - Type: metric_mock
    GroupMeta:
      meta1: meta1
    GroupTags:
      tag1: tag1
  - Type: metric_mock
    GroupMeta:
      meta2: meta2
    GroupTags:
      tag2: tag2
flushers:
  - Type: flusher_http
    RemoteURL: "http://localhost:8086/write_select_tag1"
    Convert:
      Protocol: custom_single
      Encoding: json
    FlushInterceptor: 
      Type: ext_groupinfo_filter/tag1
  - Type: flusher_http
    RemoteURL: "http://localhost:8086/write_select_tag2"
    Convert:
      Protocol: custom_single
      Encoding: json
    FlushInterceptor: 
      Type: ext_groupinfo_filter/tag2
extensions:
  - Type: ext_groupinfo_filter/tag1
    Tags:
      tag1: 
        Pattern: tag1
  - Type: ext_groupinfo_filter/tag2
    Tags:
      tag2:
        Pattern: tag2

文章大纲