Getting Data In

SplunkでLHAのアーカイブを取り込めますか?

croissant
Explorer

SplunkでLHA (LZH形式)のアーカイブファイルをZIPファイルのように取り込みたいのですが、可能でしょうか?

Can I import a LHA (LZH format) archived file?

0 Karma
1 Solution

croissant
Explorer

残念ながらSplunkはこの形式のファイルに対応していないようです。Splunkが対応している圧縮フォーマットは下記の通りです。

なお、Splunkは Linuxの file コマンドのようにファイルの中身から形式を判断しないため、必ず各縮形式と合致する下記の拡張子をお使いください。(例: ZIP形式のファイルに .zipfile という拡張子をつけても、うまく取り込まれません)

  • .tar
  • .tar.gz, .tgz, .tar.z
  • .tar.bz2 .tbz2
  • .zip

Splunk does not support this format. It will support the archive formats as above.
Note that unlike Linux file command, it will only check the file extension, instead of seeking the file itself to determine the format. (e.g. Would not work if a ZIP file has .zipfile file extension)

View solution in original post

croissant
Explorer

残念ながらSplunkはこの形式のファイルに対応していないようです。Splunkが対応している圧縮フォーマットは下記の通りです。

なお、Splunkは Linuxの file コマンドのようにファイルの中身から形式を判断しないため、必ず各縮形式と合致する下記の拡張子をお使いください。(例: ZIP形式のファイルに .zipfile という拡張子をつけても、うまく取り込まれません)

  • .tar
  • .tar.gz, .tgz, .tar.z
  • .tar.bz2 .tbz2
  • .zip

Splunk does not support this format. It will support the archive formats as above.
Note that unlike Linux file command, it will only check the file extension, instead of seeking the file itself to determine the format. (e.g. Would not work if a ZIP file has .zipfile file extension)

melonman
Motivator

すこし無理やり感がありますが、以下にlhaを解凍するのをいれたら、もしかしたら実現できそうな気がしますが、いかがでしょか。

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.

croissant
Explorer

ありがとうございます!
仰るとおり unarchive_cmd オプションでlhaを呼び出して解凍させれば、うまく取り込みができそうですね。

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...