Install Logstash on Linux or Mac OS X
Logstash is a tool for managing events and logs.w
Download package
We need to download a distribution package. So go to the elastic site and choose logstash in products.
Or simply follow this link Download logstash page
Manual Installation
Now we need to unarchive a tar.gz. So go to download folder and enter the command in terminal :
tar -xzvf /home/lytvynov/Téléchargements/logstash-6.2.4.tar.gz
Now we have unarchived logstash. To start a logstash and test it type :
cd logstash-6.2.4
bin/logstash -e “input { stdin { } } output { stdout {} }”
You should see something like that
If you don’t pass -e “…” option you’ll see the error message
Logstash needs to know input/output formats and for this, it waits for pipeline file.
Simple pipeline
You can find more details about pipelines here. I leave a simple pipeline with input in JSON format and output on rubydebug just to give an idea how it works.
input {
stdin {
codec => json
}
}output {
stdout {
codec => rubydebug
}
}
Add it to your logstash folder :
touch path_to_logstash/config/pipelines/pipeline.conf
To run logstash with this pipeline enter a command :
bin/logstash -f config/pipelines/pipeline.conf
Install Logstash with Homebrew on Mac OS X
Mac os x users should be familiar with Homebrew (brew). To install it run this command in terminal :
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Use brew command in terminal to install Logstash :
brew update
brew install logstash
To run Logstash :
logstash -e “input { stdin { } } output { stdout {} }”
Congratulations !
Now you can work with Logstash on your localhost !
Do you need help with web or mobile development? Feel free to contact me here.
P.S. I really appreciate your like or share 🙏.