Deploying logzio-mysql-logs directly via Docker
Before you begin, you’ll need:
- MySQL database hosted on Amazon RDS
- An active account with Logz.io
Pull Docker image
docker pull logzio/mysql-logs
Run the container
docker run -d --name logzio-mysql-logs -e LOGZIO_TOKEN=<<LOG-SHIPPING-TOKEN>> [-e LOGZIO_LISTENER=<<LISTENER-HOST>>] \
-e RDS_IDENTIFIER=<<YOUR_DB_IDENTIFIER>> [-e AWS_ACCESS_KEY=<<YOUR_ACCESS_KEY>>] [-e AWS_SECRET_KEY=<<YOUR_SECRET_KEY>>] [-e AWS_REGION=<<YOUR_REGION>>] \
[-e RDS_ERROR_LOG_FILE=<<PATH-TO-ERROR-LOG-FILE>>] [-e RDS_SLOW_LOG_FILE=<<PATH-TO-SLOW-LOG-FILE>>] [-e RDS_LOG_FILE=<<PATH-TO-LOG-FILE>>] \
-v path_to_directory:/var/log/logzio -v path_to_directory:/var/log/mysql \
logzio/mysql-logs:latest
docker run -d --name logzio-mysql-logs \
-e LOGZIO_TOKEN="<<LOG-SHIPPING-TOKEN>>" \
-e LOGZIO_LISTENER_HOST="<<LISTENER-HOST>>" \
-v /var/log/logzio:/var/log/logzio \
-v /var/log/mysql:/var/log/mysql \
logzio/mysql-logs:latest
Parameters
Parameter | Description | Required/Default |
---|---|---|
<<LOG-SHIPPING-TOKEN>> |
Your Logz.io account token. Replace <<LOG-SHIPPING-TOKEN>> with the token of the account you want to ship to. |
Required |
<<LISTENER-HOST>> |
Your Logz.io account listener URL. Replace <<LISTENER-HOST>> with the host for your region. For example, listener.logz.io if your account is hosted on AWS US East, or listener-nl.logz.io if hosted on Azure West Europe. The required port depends whether HTTP or HTTPS is used: HTTP = 8070, HTTPS = 8071. |
Required. Default: listener.logz.io |
<<YOUR_DB_IDENTIFIER>> |
The RDS identifier of the host from which you want to read logs from. | Required |
<<YOUR_ACCESS_KEY>> |
A proper AMI credentials for RDS logs access (permissions for download-db-log-file-portion and describe-db-log-files are needed). |
Optional |
<<YOUR_SECRET_KEY>> |
A proper AMI credentials for RDS logs access (permissions for download-db-log-file-portion and describe-db-log-files are needed). |
Optional |
<<YOUR_REGION>> |
Your AWS region | Optional. us-east-1 |
<<PATH-TO-ERROR-LOG-FILE>> |
The path to the RDS error log file. | Optional. error/mysql-error.log |
<<PATH-TO-SLOW-LOG-FILE>> |
The path to the RDS slow query log file. | Optional. slowquery/mysql-slowquery.log |
<<PATH-TO-LOG-FILE>> |
The path to the RDS general log file. | Optional. general/mysql-general.log |
Below is an example configuration for running the Docker container:
docker run -d \
--name logzio-mysql-logs \
-e LOGZIO_TOKEN=<<LOG-SHIPPING-TOKEN>> \
-e AWS_ACCESS_KEY=<<YOUR_ACCESS_KEY>> \
-e AWS_SECRET_KEY=<<YOUR_SECRET_KEY>> \
-e AWS_REGION=<<YOUR_REGION>> \
-e RDS_IDENTIFIER=<<YOUR_DB_IDENTIFIER>> \
-e RDS_ERROR_LOG_FILE=error/mysql-error.log \
-e RDS_SLOW_LOG_FILE=slowquery/mysql-slowquery.log \
-e RDS_LOG_FILE=general/mysql-general.log \
-v /var/log/logzio:/var/log/logzio \
-v /var/log/mysql:/var/log/mysql \
logzio/mysql-logs:latest
Check Logz.io for your logs
Give your logs some time to get from your system to ours, and then open Open Search Dashboards.
If you still don’t see your logs, see log shipping troubleshooting.