Splunk Search

ディレクトリ監視で圧縮ファイルを認識しない。

HiroshiSatoh
Champion

「データ入力 » ファイルとディレクトリ」でディレクトを監視して圧縮ファイル(ZIP)をディレクトリに追加したがSplunkに取り込まれません。いろいろファイルを追加してみたところ、元ファイルがUTF-8のファイルの場合は認識するが、S-JISの場合は認識しないようです。何か設定があるんでしょうか?

Tags (1)
0 Karma
1 Solution

melonman
Motivator

UTF8以外の文字コードのデータを読み込む際には、設定として文字コードの指定を行う必要があります。

http://docs.splunk.com/Documentation/Splunk/latest/Data/Configurecharactersetencoding

http://splunk-base.splunk.com/answers/66472/

*圧縮されてしまっている場合には、事前に中身の文字コードをして、設定を入れて頂く必要があります。

View solution in original post

0 Karma

HiroshiSatoh
Champion

WINDOWS7環境で圧縮されたSJISファイルを認識しなかった件は、「local」フォルダの権限に原因がありinputs.confが参照できない状態だったためでした。手動でフォルダを再作成してconfを配置したら認識するようになりました。カスタムコマンドを設定した際にSearch.logに「local」に配置したcommands.confの照会エラーがあったので気が付きました。SPLUNKのGUIで「local」フォルダが作成された場合にこのような状態になるようです。

0 Karma

HiroshiSatoh
Champion

Splunkを再インストールしてきれいな状態で再度試してみましたが、やはりSJISのファイルは取り込めませんでした。
設定は以下です。地道に検証してみます。

<\Splunk\etc\apps\search\local\inputs.conf>

[monitor://C:\WORK\DIR01]

disabled = false

followTail = 0

sourcetype = SType_SJIS_TEXT



<\Splunk\etc\system\local\props.conf>

[SType_SJIS_TEXT]

NO_BINARY_CHECK = 1

pulldown_type = 1

CHARSET=SHIFT-JIS

0 Karma

melonman
Motivator

UTF8以外の文字コードのデータを読み込む際には、設定として文字コードの指定を行う必要があります。

http://docs.splunk.com/Documentation/Splunk/latest/Data/Configurecharactersetencoding

http://splunk-base.splunk.com/answers/66472/

*圧縮されてしまっている場合には、事前に中身の文字コードをして、設定を入れて頂く必要があります。

0 Karma

HiroshiSatoh
Champion

いつの間にかSHIFT-JISのファイルを取り込めるようになっていました。原因がはっきりわかったらアップします。

0 Karma

HiroshiSatoh
Champion

回答ありがとうございます。props.confに設定を入れて試してみてますがうまく認識しません。文字コードの指定は何(ソース、ソースタイプ、ホスト等)に対して設定するんでしょうか?

以下はソースタイプで設定した内容です。
[MY_CSV_FILE2]
NO_BINARY_CHECK = 1
pulldown_type = 1
CHECK_FOR_HEADER = true
REPORT-AutoHeader = AutoHeader-my_type
CHARSET = SHIFT-JIS

(WINDOWS7環境で実施)

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...