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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...