我目前正在尝试使用Logstash将json文件放入弹性搜索。我不确定自己是否做得正确,也不确定如何检查弹性搜索实例以确保自己做得正确。
这是我的配置文件和JSON
input{
file{
path => "/Users/CFP668/Downloads/gs-accessing-data-mysql-master/complete/example.json"
codec => json
start_position => "beginning"
}
}
filter{
json{
source => "message"
}
}
output{
elasticsearch{
hosts => "localhost:9200"
index => "test"
}
stdout { codec => rubydebug }
}
{"name":"Jonathan","score":"9.9","address":"New Delhi"}
{"name":"Sam","score":"8.9","address":"New York"}
{"name":"Michelle","score":"9.0","address":"California"}