【发布时间】:2020-05-29 23:20:58
【问题描述】:
我有一个有效的 Splunk 搜索,它从日志语句中的 xml 文件中提取数据。搜索会创建一个包含 14 列的表。以下是创建此表的查询
<sourcetype and other data>..| xmlkv | rex max_match=0 "\<ns2\:numberCode\>(?P<location>[^\<]+)"| eval Segment1_Origin = mvindex(location, 7), Segment1_Destination = mvindex(location, 8), Segment2_Origin = mvindex(location, 10), Segment2_Destination = mvindex(location, 11), Segment3_Origin = mvindex(location, 13), Segment3_Destination = mvindex(location, 14) | rex max_match=0 "\<carrier\>(?P<carrier>[^\<]+)" | eval Segment1_Carrier = mvindex(carrier, 0), Segment2_Carrier = mvindex(carrier, 1), Segment3_Carrier = mvindex(carrier, 2) | rex max_match=0 "\<billingMethod\>(?P<billingMethod>[^\<]+)" | eval Segment1_BillingMethod = mvindex(billingMethod, 0), Segment2_BillingMethod = mvindex(billingMethod, 1), Segment3_BillingMethod = mvindex(billingMethod, 2) | table purchCostReference, eventType, Segment1_Carrier, Segment1_BillingMethod, Segment1_Origin, Segment1_Destination, Segment2_Carrier, Segment2_BillingMethod, Segment2_Origin, Segment2_Destination, Segment3_Carrier, Segment3_BillingMethod, Segment3_Origin, Segment3_Destination | sort purchCostReference, eventType
在 Splunk 中是否可以使用这些表格设计中的任何一种?
【问题讨论】:
标签: splunk