Elk -- logstash

Source: Internet
Author: User
Tags logstash

Logstash is an open-source server-side data processing pipeline. It can collect data from multiple sources, convert data, and send the data to your favorite "repository.

Official Website introduction:
Https://www.elastic.co/cn/products/logstash

Https://www.elastic.co/downloads/logstash

1. Download

Logstash depends on jdk1.8. Therefore, make sure that jdk1.8 has been installed and configured on the machine before installation.
1) follow the download tips on the official website and decompress the package.
2) configure the running path to the Environment Variable
3) run the logstash command to test whether the installation is successful.

2. Introduction

After logstash, you can add:
?? -F: Specify the configuration file and configure logstash according to the configuration file.
? -E: string, which is configured. The default value is "stdin input and stdout output (input and output in the console). It can be set through the command line.
?? -L: Output address, which is output by console by default.
?? -T: exit after testing whether the configuration file is correct

 
# Input {...} # filter {...} # output {...}
3. Example: read from standard input without any filtering and read to standard output.

Logstash-e 'input {stdin {}} output {stdout {}}'

4. Example: read from a file
 
Input {# Read log information from the file {Path => "/var/log/error. log "type =>" error "start_position =>" beginning "}}# filter {#} output {# stdout {codec => rubydebug }}

Run the following command:
Logstash-F logstash. conf

5. Common output: Database

Change the output location to the following:

 
Output {redis {Host => "127.0.0.1" Port => 3213 Password => "123457" DB => 1 data_type => "error" Key => "logstash"} stdout {Codec => rubydebug }}

Elk -- logstash

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.