2012-02-27 139 views
1

我正在使用Splunk將具有相同名稱的多個字段的日誌編入索引。所有字段的含義相同: 2012-02-22 13:10:00,ip = 127.0.0.1,to = email1 @ example.com,to = email2 @ example.comSplunk:提取具有相同名稱的多個字段

在自動提取中事件中,我只會將「[email protected]」提取爲「to」字段。我怎樣才能確保提取所有的值?

謝謝!

回答

2

我認爲加上這給搜索結束,這可能做到這一點:

| extract pairdelim="," kvdelim="=" mv_add=t | table to 

(以下簡稱「表」僅僅是用於演示)。

所以,我認爲,在 'transforms.conf'(從http://docs.splunk.com/Documentation/Splunk/latest/admin/transformsconf)提出:

[my-to-extraction] 
DELIMS = ",", "=" 
MV_ADD = true 

和 'props.conf' 引用它:

[eventtype::my_custom_eventtype] 
REPORT-to = my-to-extraction 

其中「事件類型:: my_custom_eventtype'可以是任何可用作'props.conf'規範的東西(<規範>在http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf)。

相關問題