Collects and parses the slow logs and error logs created by MySQL

When you run this module, it performs a few tasks under the hood:

  • Sets the default paths to the log files (but don’t worry, you can override the defaults)
  • Makes sure each multiline log event gets sent as a single event
  • Uses ingest node to parse and process the log lines, shaping the data into a structure suitable for visualizing in Kibana
  • Deploys dashboards for visualizing the log data

Compatibility

The MySQL module was tested with logs from versions 5.5 and 5.7.

On Windows, the module was tested with MySQL installed from the Chocolatey repository.

Installation

Linux:

If you haven't already installed filebeat...

  1. Enter the following script into the console using elevated privileges
curl https://github.com/themarcusaurelius/vizion.ai/blob/master/beat-install-scripts/install-config-mysql.sh > install-config-mysql.sh; chmod a+x  install-config-mysql.sh; ./install-config-mysql.sh _PLACEHOLDER_API_ENDPOINT_
  1. When prompted, select the proper environment to complete the installation.

Data should now be shipping to your Vizion Elastic app. Check the Discover tab in Kibana for the incoming logs


If you have already installed filebeat...

  1. Enable the module.
filebeat modules enable mysql
  1. Restart Filebeat.
service filebeat restart

Data should now be shipping to your Vizion Elastic app. Check the Discover tab in Kibana for the incoming logs


Windows:

If you haven't already installed filebeat...

  1. As administrator, enter the following command in Powershell or download the zip file here.
Start-BitsTransfer -Source 'https://github.com/themarcusaurelius/Filebeat-Modules/archive/master.zip' -Destination 'C:\Users\Administrator\Downloads\Filebeat-Modules.zip'
  1. Unzip the package and extract the contents to the C:/ drive.

  2. Back in Powershell, CD into the extracted folder and run the following script:

.\installFilebeat.ps1
  1. When prompted, enter your credentials below and click OK.
Kibana URL: _PLACEHOLDER_KIBANA_URL_
Username: _PLACEHOLDER_USERNAME_
Password: _PLACEHOLDER_PASSWORD_
Elasticsearch API Endpoint: _PLACEHOLDER_API_ENDPOINT_
  1. Choose the MySQL module and click OK.

This will install and run Filebeat with the module you enabled set to that particular modules default file path.

Data should now be shipping to your Vizion Elastic app. Check the Discover tab in Kibana for the incoming logs


If you have already installed filebeat...

  1. In Powershell, as administrator, CD into the Filebeat folder and enter the following command:
.\filebeat.exe modules enable mysql
  1. Restart Filebeat to initate the changes.
restart-service filebeat

Data should now be shipping to your Vizion Elastic app. Check the Discover tab in Kibana for the incoming logs


Example Dashboard

This module comes with a sample dashboard. For example:

Imgur