Skip to content

Commit e65f8e1

Browse files
committed
feat: add xml_attribute matching config for payload_xml_value
This adds xml_attribute schema fields and example usage so XML extraction can be constrained by attribute name/value alongside existing match conditions.
1 parent 733bd92 commit e65f8e1

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

server/agent_config/custom_app.example.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ biz_field:
7272
value: 5
7373
output:
7474
attribute_name: "tlv_c5"
75+
- name: "xml_attr_field"
76+
type: "payload_xml_value"
77+
match:
78+
type: "string"
79+
keyword: "data"
80+
xml_attribute:
81+
name: "name"
82+
value: "TRAN_TIMESTAMP"
83+
ignore_case: false
84+
post:
85+
- type: parse_xml_value
86+
settings:
87+
- key: keyword
88+
value: "field"
89+
- key: type
90+
value: "string"
91+
- key: ignore_case
92+
value: false
93+
output:
94+
attribute_name: "xml_attr_field"
7595
- name: "my_field"
7696
enabled: false
7797
type: "http_url_field"

server/agent_config/custom_app.schema.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,36 @@ $defs:
501501
default: false
502502
description@en: 'Whether to ignore case, default value: false, only effective when `Type` (`type`) is `String` (`string`).'
503503
description@ch: 是否忽略大小写,默认值:false,仅当 `匹配类型`(`type`)为 `字符串`(`string`)时有效。
504+
xml_attribute:
505+
type: object
506+
title@en: XML Attribute Match
507+
title@ch: XML 属性匹配
508+
description@en: |-
509+
Optional XML attribute matcher, only effective for `Payload XML Value` (`payload_xml_value`).
510+
511+
Default values are empty for all fields, meaning attribute matching is skipped.
512+
When `Name` (`name`) and `Value` (`value`) are both non-empty, this matcher is enabled and combined with `Match` (`match`) using AND semantics.
513+
description@ch: |-
514+
可选的 XML 属性匹配,仅对 `XML 内容提取` (`payload_xml_value`) 生效。
515+
516+
三个字段默认均为空,表示跳过属性匹配。
517+
仅当 `属性名`(`name`)和 `属性值`(`value`)都为非空时启用,并与 `匹配`(`match`)按 AND 关系同时生效。
518+
properties:
519+
name:
520+
type: string
521+
default: ""
522+
title@en: Attribute Name
523+
title@ch: 属性名
524+
value:
525+
type: string
526+
default: ""
527+
title@en: Attribute Value
528+
title@ch: 属性值
529+
ignore_case:
530+
type: boolean
531+
default: false
532+
title@en: Ignore Case
533+
title@ch: 忽略大小写
504534
all_leaves:
505535
type: boolean
506536
title@en: All Leaves

0 commit comments

Comments
 (0)