Windows system:1, installation Logstash1.1 access to the official website Download Zip package[1] https://artifacts.elastic.co/downloads/logstash/logstash-6.3.2.zip 6.3.2 versionif you want to download the latest or other version, you can go to the official website and select the download page[2] https://www.elastic.co/products/logstash
Logstash Quick Start, logstashOriginal article address: WorkshopIntroduction Logstash is a tool for receiving, processing, and forwarding logs. Supports system logs, webserver logs, error logs, and application logs. In short, it includes all types of logs that can be flushed. How does it sound amazing?In a typical use case (ELK): Elasticsearch is used as the storage of background data, and kibana is used fo
are as follows:
For example, the/home/husen/config/directory has
//in1.conf, in2.conf, filter1.conf, filter2.conf, out.conf these 5 files
//We use/ Logstash-5.5.1/bin/logstash-f/home/husen/config boot Logtstash
//logstash automatically loads this 5 configuration file and m
Environment Support (JAVA)
yum -y install java-1.8*java --version2. Download and decompress logstash
Logstash-5.0.1.tar.gztar-zxvf logstash-5.0.1.tar.gzcd logstash-5.0.1mkdir conf # create conf folder to store configuration file cd conf3. Configuration File
Configure the test file (combined with the elasticsearch clus
Logstash output format.
Start with the following command:
1
#./bin/logstash agent-f logstash-test.conf
When you start, what you enter on the screen will be displayed in the console. If you enter "hehe", it appears as follows:
Indicates that the installation was successful. Use CTRL + C to exit the process.
3. Install Elasticsearch:
" "%{id}" }}
hosts: ES cluster address
user: ES user Name
password: es password
index: Import to the index name in es, where I set the name of the MySQL table directly
document_id: The document ID imported into ES, which needs to be set to primary key, otherwise the same record will be updated in ES with two records indicating the %{id} value of the field referenced in the MySQL table id
RunSave the above code in a configuration file sync_table.cfg , execute the
Type in logstash, logstash typeTypes in logstash
Array
Boolean
Bytes
Codec
Hash
Number
Password
Path
String
Array
An array can be a single string value or multiple values. If you specify the same setting multiple times, it appends to the array.Example:
path => [ "/var/log/messages", "/var/log/*.log" ]path => "/data/mysql/mysql.log"Boolean
Boolean, true,
"Key = "Logstash"codec = ' json '}}Output {Elasticsearch {Host = "127.0.0.1"}}Elasticsearch/USR/LOCAL/ELASTICSEARCH-1.6.0/CONFIG/ELASTICSEARCH.YML Keep the defaultKibana/USR/LOCAL/KIBANA-4.1.1-LINUX-X64/CONFIG/KIBANA.YML Keep the default192.168.122.1onThe Redis configuration is not moving ...192.168.122.2onNginxof the#nginx这里的区别就是log这块的配置, formatted as a JSONLog_
server as the Redis,elasticsearch.
Downloadwget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz
Redis installation configuration is slightly, but be careful to monitor the Redis queue length, if the long heap description elasticsearch problemCheck the length of the data list in Redis every 2S, 100 timesRedis-cli-r 100-i 2 Llen
, spontaneous self-collection, centralized is collected centrally, a server receives all shipper (personal understanding is Logstash agent) log.Actually logstash itself does not divide what shipper and collector, just is the configuration file is different, we this time in the centralized way to testThere are two servers here.192.168.124.128 Logstash INDEX,ELASTI
adding or modifying inputs, outputs, and filters in your profile, thus making it easier to tailor a more reasonable storage format for the query.Integrated Elasticsearch Insert data above steps have been successfully built Logstash, then add logstash configuration file, so that its configuration file start, the data into ES, display1. Add logs.conf under the/root/confi
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.