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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...