logstashのfileプラグインのpathの指定ではまりました。 確かにTypeはArrayとは書いてあるが、
ドキュメントには文字列でも大丈夫と読み取れる(私は読み取ってしまった)サンプルコードがの記述がある。
指定ディレクトリが一つだけだったので、サンプルコードのやり方を参考に文字列で記述した。
Logstash
- version 2.1.3
公式ドキュメント
公式ドキュメントから引用しています。
このサンプルコードを見て文字列で記述してしまうの普通ではない???
Structrue of a Config File
Plugin Configuration
The configuration of a plugin consists of the plugin name followed by a block of settings for that
plugin. For example, this input section configures two file inputs:
input {
file {
path => "/var/log/messages"
type => "syslog"
}
file {
path => "/var/log/apache/access.log"
type => "apache"
}
}
(省略)
Value Types
A plugin can require that the value for a setting be a certain type, such as boolean or hash. The
following value types are supported.
An array can be a single string value or multiplvalues. If you specify the same setting multiple
times, it appends to the array.
Example:
path => [ "/var/log/messages", "/var/log/*.log" ]
path => "/data/mysql/mysql.log"
学んだこと
- 公式ドキュメントも注意深く見ることが重要
- 可能性が2つあるならどちらも試す