Null result of MySQL query through logstash does not create an index


(Saafia NM) #1

I have to Fetch the Today's status from my MYSQL table. Result From Table is empty. when i creating an index with null result of data the index does not created. What i am missing?
this is my config file:

input {
jdbc {
jdbc_driver_library => "C:/New_ELK/logstash-5.5.2/mysql-connector-java-5.1.42/mysql-connector-java-5.1.42-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/emob_report"
jdbc_user => "root"
jdbc_password => ""
statement => "select * from attendance
where punchin_date=curdate()"
}
}

output {
elasticsearch {
index => "users_punched_in"
hosts => ["localhost:9200"]

}

stdout { codec => json_lines }
}


(Christian Dahlqvist) #2

Logstash does not actively create the index - Elasticsearch does this when it encounters the first document belonging to that index. If there is no data to index, no index will therefore be created.


(Saafia NM) #3

Thank You!!!


(system) #4

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