Logstash
Installation and Deployment
First, the Environment configuration
Operating system: Cent OS 7
Logstash version: 2.1.1.tar.gz
JDK version: 1.7.0_51
SSH Secure Shell version: Xshell 5
Second, the operation process 1, download the specified version of the Logstash and unzip
Download:Curl-o https://download.elasticsearch.org/logstash/logstash/logstash-2.1.1.tar.gz decompression:tar zxvf Logstash-2.1.1.tar.gz
2. Run the test
In the terminal, run the command as follows to start the Logstash process:
CD Logstash-2.1.1/bin ./logstash-e ' Input{stdin{}}output{stdout{codec=>rubydebug}} '
Then you will find that the terminal is waiting for your input. No problem, hit Hello world, enter, and see what results will be returned!
./logstash-e ' Input{stdin{}}output{stdout{codec=>rubydebug}} ' Hello world{ "message" = "Hello World", "@version" = "1", "@timestamp" = "2015-11-30t09:07:18.529z", "host" and "=" Atman081.atmandomain "}
That's right! You took care of it! That's all you have to do.
3. Simple scene-monitor log file and output to Kafka in message form
Input {file {path= ["/var/log/diagonalley/diagonalley.log"] Type="log4j"start_position="beginning"}}output {kafka {bootstrap_servers="192.168.1.181:9092,192.168.1.181:9093,192.168.1.181:9094"topic_id="Logstash"Compression_type="gzip" }}
./logstash-f Stdout_kafka.conf &
4. Simple Scene-monitor Kafka message and output value Elasticsearch
input {kafka {zk_connect = 192.168.1.181:2181 topic_id = logstash " }}output {elasticsearch {hosts = [ " 192.168.1.181:9100 " ] Index = logstash-%{type}-%{+ YYYY. MM.DD} workers = 5
./logstash-f Stdout_elasticsearch.conf &
Logstash Installation and Deployment