-
Download and install the Public Signing Key, not required as we have added it previously:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
-
Add repository definition, not required as we have added it previously:
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | \ sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list && sudo apt-get update
-
Install logstash from the repository:
sudo apt-get install logstash
-
Create a manual pipeline for Logstash
cd /usr/share/logstash sudo bin/logstash -e 'input { stdin { } } output { stdout {} }'
-
-e
enables specifying configuration directly from the command line -
stdin: filehandle that process reads to get information from you, human
-
stdout: process writes log information to this filehandle
-
After the pipeline has started
...Pipelines running...
type in the terminal:
Hello World!
And press enter
-
Expected response:
{ "host" => "ip-172-31-19-36", "message" => "Hello World!", "@timestamp" => 2020-03-25T23:00:16.476Z, "@version" => "1" }
-
Logstash adds a timestamp, version and the hostname to the message we sent
-
To exit use keyboard combination
Ctrl-D
orCtrl-C
to shut down the logstash process