input {
stdin { }
jdbc {
#### type => "boss_city_info"
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/es"
jdbc_user => "root"
jdbc_password => "mysql@123A"
jdbc_driver_library => "/home/admin/lib/mysql-connector-java-5.1.46.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM boss_city_info"
}
}
output {
stdout {
codec => json_lines
}
elasticsearch {
hosts => "127.0.0.1:9200"
index => "boss"
document_type => "boss_city_info"
}
}
POST /boss/boss_city_info/_search
{
"query": {
"term": {
"city": {
"value": "济南"
}
}
}
}
PUT /boss
{
"settings":{
"number_of_replicas":1,
"number_of_shards":2
},
"mappings":{
"boss_city_info":{
"properties":{
"primary_key":{
"index":true,
"type":"integer"
},
"city":{
"type":"text",
"analyzer":"ik_max_word"
},
"city_code":{
"type":"text"
},
"province_key":{
"type":"integer"
}
}
}
}
}