Logstash Installation and Deployment

Source: Internet
Author: User

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
    • Define a stdout_kafka.conf file with the configuration content of

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"    }}

    • Put the stdout_kafka.conf file into the bin directory

    • Run the following command and view the console output

./logstash-f Stdout_kafka.conf &

4. Simple Scene-monitor Kafka message and output value Elasticsearch
    • Define a stdout_elasticsearch.conf file with the configuration content of

 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   

    • Put the stdout_elasticsearch.conf file into the bin directory

    • Run the following command and view the console output

./logstash-f Stdout_elasticsearch.conf &

Logstash Installation and Deployment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.