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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...