How to import mysql data into elastic search


i need to know about how to import the mysql data into elasticsearch,

can u people please explain about what are software required for kibana visualize.

i'm not clearly understand about procedures,

what are steps i need to follow?

please explain about the flows, how the data is imported in elasticsearch and how it goes to kibana, i googled many times, but i'm facing many issues.

please provide some sample example from installation to kibana visuals.

(David Pilato) #2

You can use something like logstash and its jdbc input to read from your DB and push json to elasticsearch.

but i'm facing many issues.

Which are?


Error: Could not find or load main class folder\logstash-6.4.1\logstash-6.4.1\logstash-core\lib\jars\commons-codec-1.11.jar;


input {
jdbc {
jdbc_connection_string => "jdbc:mysql://"
# The user we wish to execute our statement as
jdbc_user => "Test"
jdbc_password => "*****"
# The path to our downloaded jdbc driver
jdbc_driver_library => "D:\New folder\mysql-connector-java-5.1.47-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
statement => "SELECT * FROM tbl_softwarelicenseinventory;"
output {
elasticsearch {
hosts => ""
index => "softwares"
document_type => "software"
document_id => "%{SoftwareLincenseInvetory_Id}"


these are the inputs given in config file, while running it i'm facing errors,.

(David Pilato) #6

This is probably a bad installation of Logstash. Not sure what you did...
Make sure you are following the instructions here:


I imported data from mysql to kibana, but in kibana it shows only one row.
how to get the full data ?

(David Pilato) #8

Probably you are using the same _id for all documents... That's a blind guess though as I have no idea of what you are doing.


No, i'm used different id


i took the primary key in every mysql table as id


i'm having doubt on creating pie chart,

i want to create dashboard based on two index, then only i can achieve the correct output.

but in kibana visual there is only one field is available, how to select multiple fields and how to join two index?

(David Pilato) #12

That's probably a #kibana question. You should ask there.
As for elasticsearch, there's not really join support unless you use parent / child feature. But Kibana does not support this.


thank you


is possible to create if conditional statement in elasticsearch?

(David Pilato) #16

No it's not.

(system) #17

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.