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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...