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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...