Hi everybody, im newbie and i try use logstash, elasticsearch to
Search in my Web. One error appear and i dont know how to fix it.
Pls help me , thanks you!
i tried config file .conf look like this ,it work normal , my databse appear in my plugin /head
file: simple-out.conf
input {
jdbc {
jdbc_connection_string => "jdbc:postgresql://localhost:5432/Test"
jdbc_user => "postgres"
jdbc_password =>"lovely19"
jdbc_validate_connection => true
jdbc_driver_library => "/home/ngocpt/Downloads/postgresql-9.4-1202.jdbc4.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT * from users"
}
}
output {
elasticsearch {
protocol => http
index => "users"
document_type => "user"
document_id => "%{id}"
host => "localhost"
}
}
But after i tried mapping one field with analyzer before run logstash index database, i get error.
my mapping look like this:
curl -XPUT "http://localhost:9200/users/" -d'
{
"mappings": {
"user": {
"properties": {
"password" : {
"analyzer" : "vi_analyzer",
"type" : "string"
},
"user_name" : {
"analyzer" : "vi_analyzer",
"type" : "string"
}
}
}
}
}'
Here is my error
failed
action with response of 500, dropping action: ["index", {:_id=>81,
:_index=>"users", :_type=>"user", :_routing=>nil},
#<LogStash::Event:0x6080f83f @metadata_accessors=#<LogStash::Util::Accessors:0xa36e532
@store={"retry_count"=>0}, @lut={}>, @cancelled=false,
@data={"id"=>81, "user_name"=>"dong ho", "password"=>"dong ho",
"sex"=>"male", "photo_id"=>1, "@version"=>"1",
"@timestamp"=>"2015-11-02T10:40:21.245Z"}, @metadata={"retry_count"=>0}, @accessors=#<LogStash::Util::Accessors:0xb7502dc
@store={"id"=>81, "user_name"=>"dong ho", "password"=>"dong
ho", "sex"=>"male", "photo_id"=>1, "@version"=>"1",
"@timestamp"=>"2015-11-02T10:40:21.245Z"},
@lut={"id"=>[{"id"=>81, "user_name"=>"dong ho",
"password"=>"dong ho", "sex"=>"male", "photo_id"=>1,
"@version"=>"1", "@timestamp"=>"2015-11-02T10:40:21.245Z"}, "id"]}>>] {:level=>:warn}
Thanks for your help