Error: com.mysql.cj.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library? code example

Example 1: Error: com.mysql.cj.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?

You might be using mysql-connector-java_5.1.45,
and specifying "com.mysql.cj.jdbc.Driver" as the driver class.
You should use either mysql-connector-java_8.0.21, or use the old
driver class "com.mysql.jdbc.Driver"

Example 2: Error: com.mysql.cj.jdbc.Driver not loaded. Are you sure you've included the correct jdbc driver in :jdbc_driver_library?

for logstash 6.2.x and above, prefer adding the drivers under:

/usr/share/logstash/logstash-core/lib/jars/

and rather keep the jdbc_driver_library empty.
This has been quoted in many of the elastic.co forums too.

Tags:

Misc Example