Logstashを指定したログファイルから読み込むように設定しようとしています。 stdinから読み込むように設定すると、期待どおりに動作し、Logstashからのメッセージが入力され、Kibana UIに表示されます。私はファイル入力でLogstashを実行するとLogstashが設定された入力ファイルから読み込まない
$ cat /tmp/logstash-stdin.conf
input {
stdin {}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
$./logstash -f /tmp/logstash-stdin.conf
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
The stdin plugin is now waiting for input:
hellloooo
{
"@version" => "1",
"host" => "myhost.com",
"@timestamp" => 2017-11-17T16:05:41.595Z,
"message" => "hellloooo"
}
はしかし、私は、ファイルがLogstashにロードされるという兆候を取得していない、そしてそれはKibanaには表示されません。
$ cat /tmp/logstash-simple.conf
input {
file {
path => "/tmp/test_log.txt"
type => "syslog"
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}
$ ./logstash -f /tmp/logstash-simple.conf
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
Logstashが設定ファイルを取り込まない理由をトラブルシューティングする方法の提案はありますか?
しかし、Logstashを起動した後でファイルに書き込んでいますか? – mustaccio
私はそうではないと分かっていませんでしたが、これは必要なのですが...既存のログファイルを読み取るオプションはありませんか? – ab11
@mustaccioどのようにフォルダから読み込むためにlogstashを設定するのですか?次のように設定を変更すると、logstashの起動時にフォルダにファイルがあるかどうかに関係なく、何も取り込まれません。また、logstashが実行されているときにファイルを修正するか、logstashの実行中に新しいファイルをフォルダに移動します。ファイル{ パス=> "/tmp/logstash_input/*.*" start_position =>開始 } – ab11