Hello I'm fairly new to ES and I'm not quite sure what is not working here.
I have indexed a Mysql table with the following logstash config.
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/?user=root"
jdbc_user => "root"
jdbc_validate_connection => true
jdbc_driver_library => "C:/Users/ggarciro/Documents/elastic/logstash-7.1.0/lib/mysql-connector-java-8.0.16.jar"
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
statement => "SELECT * FROM employees.employees where gender = 'M'"
}
}
output {
elasticsearch {
index => "male_employees"
document_id => "%{id}"
hosts => ["localhost:9200"]
user => "elastic"
password => "elastihusky"
}
stdout{ codec => json_lines}
}
However when i try to do a simple get as for example.
GET /male_employees/_search
{
"query": {
"match": {
"first_name": "Zsolt"
}
}
}
I get something like this
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" :
}
}
I see in the index stats this -> "index_total": 179973,
So I dont know why I don't get any hits.
Edit: For some reason the indexes health are displayed as yellow (I don't know why is that)
I have also restarted ES and Kibana, but I have still no hits.
Edit2: I think is adding all entries of the Mysql as one document under the same index, but I need each entry to be it's own.
What am I doing wrong?
Thank you