Knowledge Management

XMLでAttributeを指定して検索する方法について

takoyakiman
New Member

props.confに以下の設定をして、XMLを取り込んでいます。
 KV_MODE = xml
 pulldown_type = 1
 NO_BINARY_CHECK = 1
 SHOULD_LINEMERGE = true
このとき、XMLでAttributeを指定して検索する方法を教えて下さい。

具体的には以下のようなデータの検索となります。

ABC


DEF

上記のようなXMLを取り込んだときにaaa no="9"のbbbの値(この場合DEF)を
取得したい場合の検索方法を教えて下さい。

Tags (1)
0 Karma
1 Solution

Shisa
Explorer

エレメント単位でイベント改行することでシンプルに検索できます。

props.confに以下を追加

LINE_BREAKER = >(\s+)<aaa

aaa{@no},aaa.bbb フィールドが抽出されるので、以下でaaa no="9"のbbbの値が取得できます。

aaa{@no}=9 | table aaa.bbb

View solution in original post

0 Karma

Shisa
Explorer

エレメント単位でイベント改行することでシンプルに検索できます。

props.confに以下を追加

LINE_BREAKER = >(\s+)<aaa

aaa{@no},aaa.bbb フィールドが抽出されるので、以下でaaa no="9"のbbbの値が取得できます。

aaa{@no}=9 | table aaa.bbb

0 Karma
Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Building Momentum: Splunk Developer Program at .conf25

At Splunk, developers are at the heart of innovation. That’s why this year at .conf25, we officially launched ...