![]() Filebeat supports compression and can be easily configured in a YAML file. Compared with previous versions, Filebeat 6.7.0 is very lightweight and can effectively ship log events. Here, you can see all the information about MySQL, including the following queries and error logs.Īs shown in this tutorial, Filebeat is an excellent log shipping solution for MySQL databases and Elasticsearch clusters. Go to the Kibana dashboard Overview ECS and view the collected data. Restart and query the MySQL database, so that a slow log and an error log are generated accordingly. # sudo service filebeat start Kibana Dashboard Run the following commands to upload the dashboard, pipeline, and template information to Elasticsearch and Kibana. # Filebeat will choose the paths depending on your OS. # Optional protocol and basic auth credentials. Enter an Elasticsearch address and a port number. # In case you specify and additional path, the scheme is required: # IPv6 addresses should always be defined as: host: "" 3. # Scheme and port can be left out and will be set to the default (http and 5601) The modules are dynamically loaded, so the paths are used to specify the locations of modules. Therefore, you need to specify the paths of your error log and slow log by using modules. MySQL detects error logs and slow logs separately. # Period on which files under path should be checked for changes Configure dynamic loading of Filebeat modules. When you modify the filebeat.yml file, consider the following steps: 1. Install Filebeat and make modifications step by step according to the requirements on the page. To install Filebeat on CentOS, log on to the Elasticsearch console, go to the Kibana console, click Home, and click Add log data. For example, run the chmod 777 slow-mysql-query.log statement. After a log file is created, grant the read and write permissions to all users. Therefore, you need to manually create one. Note: MySQL does not automatically create log files. Slow_query_log_file=/var/log/mysql/slow-mysql-query.log You can also enable the temporary slow log feature by running the following commands: # vim /etc/my.cnf These configurations are disabled by default and need to be manually enabled. ![]() Next, configure an error log file and a slow query log file in my.cnf. #Use mysqladmin to set the root password# You need to install MySQL by running the following commands: # yum install mysql-server Prepare the Alibaba Cloud Elasticsearch 6.7 environment, use the user name and password you created to log on to Kibana, and import the data into Elasticsearch.Prepare the CentOS v7.4 Elastic Cloud Server (ECS) environment and disable Security-Enhanced Linux (SELinux) and the firewall.This article gives a detailed description of the use of Filebeat to transfer MySQL log information to Elasticsearch. Written by Liu Xiaoguo, an advocate of the China Elasticsearch Community
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |