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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...