Logstash integration

  • Website address: www.elastic.co/cn/download…

The 1.1 Linux system

  1. Create the logstash folder in the ES installation directory
  2. Decompress the logstash installation file to the new logstash folder
    • Tar -zxvf logstash-7.8.0.tar.gz -c /opt/es/logstash

  1. Modify the configuration file and add e
    • The standard configuration file contains input, Output, and filter
  2. You can use the command line to start the system. You do not need the ES user to start the system
    • CD/opt/es/logstash/logstash – 7.8.0 / bin
    • ./logstash -e ‘input { stdin { } } output { stdout {} }’
  3. When started from the command line, port 9600 is listened on by default. (Note that logstash has no UI and this port is only used as a listener.)

  1. Since you accept standard input and standard output, you can enter tests

  1. In addition to the COMMAND line interface (CLI), you can also add startup parameters to the configuration file and specify the configuration file to start the system
    • The standard configuration file contains input, Output, and filter
    • Create the ogstash. Conf file under config and configure the following configuration
    • ./logstash -f logstash.conf
input {
    stdin {}
}
output {
    stdout {}
}
Copy the code

1.2 Windows Installation

  1. To complete the installation, download the Windows installation package and decompress the package
  2. Go to the bin directory and run the following command to start the system using cli parameters
    • .\logstash.bat -e ‘input { stdin { } } output { stdout {} }
    • After startup, you can enter test commands on the interface
hello
{
       "message"= >"hello\r"."@version"= >"1"."host"= >"DESKTOP-MBL60LI"."@timestamp" => 2021-06-10T07:02:40.642Z
}
Copy the code
  1. Start in configuration file mode
    • Create the logstash. Conf file in config
    • Add parameters specified by command line parameters to the configuration file
    • Specify the configuration file to start: **.\logstash. Bat -f.. \config\logstash.conf**
input {
    stdin {}
}
output {
    stdout {}
}
Copy the code

Logstash core plugin

2.1 input plug-in

  • Reference: www.elastic.co/guide/en/lo…

2.2 the filter plugin

  • Reference: www.elastic.co/guide/en/lo…

2.3 the output plug-in

  • Reference: www.elastic.co/guide/en/lo…