概要
ここでは、Logstashのインストール手順を記載します。
OS:Windows 10
Logstash バージョン:7.8.1
インストール手順
以下のURLから、OSに合ったインストーラをダウンロードします。

Download Logstash | Elastic
Download Logstash or the complete Elastic Stack (formerly ELK stack) for free and start collecting, searching, and analy...
ダウンロードしたファイル(logstash-7.8.1.zip)を解凍します。
以下の内容で、「logstash.conf」を作成します。
※単純に、標準入力を標準出力する設定ファイルです
input{
stdin{}
}
output{
stdout{ codec => rubydebug }
}
解凍したフォルダ内の、「bin/logstash.bat」を上記で作成した、設定ファイルを指定して起動します。
logstash.bat -f C:\logstash-7.8.1\config\logstash.conf
起動後に、標準入力に例えば「testmessage」と入力して、Enterキーを押すと、以下の内容が標準出力されます。
{
"@version" => "1",
"host" => "XXXXXXXXXX",
"message" => "testmessage\r",
"@timestamp" => 2020-08-07T13:44:12.389Z
}
以上、Logstashのインストール方法を解説しました。
その他
設定ファイルを指定する以外に、-eコマンドで、直接設定を指定できます。
logstash.bat -e "input { stdin { } } output { stdout {} }"


コメント