2015-07-13 71 views
1

我是Splunk的新手,我希望優化日誌數據文件(做無損壓縮),我將添加到splunk中。由於數據必須是文本(不是二進制或任何其他格式),我不能去huffman編碼等,並不知道從哪裏開始。Splunk日誌數據優化

任何幫助/想法都會很棒。

回答

3

根據Monitor files and directories

Splunk的企業解壓縮歸檔文件它索引他們。它可以處理這些常見的歸檔文件類型:tar,gz,bz2,tar.gz,tgz,tbz,tbz2,zip和z。

我建議使用任何上述壓縮方法,然後配置Splunk以使用UI或props.conf通過文件名或目錄規範來監視文件。如果由於某種原因需要使用不同的壓縮算法,則可以這樣做,然後指示Splunk在索引管道期間使用特殊的unarchive_cmd。您可以通過查看props.conf.spec來了解更多信息。以下是相關部分:

unarchive_cmd = <string> 
* Only called if invalid_cause is set to "archive". 
* This field is only valid on [source::<source>] stanzas. 
* <string> specifies the shell command to run to extract an archived source. 
* Must be a shell command that takes input on stdin and produces output on stdout. 
* Use _auto for Splunk's automatic handling of archive files (tar, tar.gz, tgz, tbz, tbz2, zip) 
* This setting applies at input time, when data is first read by Splunk. 
    The setting is used on a Splunk system that has configured inputs acquiring the data. 
* Defaults to empty.