Hello I'm trying to insert mongodb collection to elasticsearch with this conf file but it give me following error.
"error"=>{"type"=>"mapper_parsing_exception", "reason"=>"Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters."}}}}
I think generateId => false configuration will solve this problem but it still give me the same error
How can i solve this problem?
My code:
input {
mongodb {
uri => 'mongodb://mongodbid:mongodbpassword@iplocationofmongodb/dbname'
placeholder_db_dir => "/opt/logstash-mongodb/"
placeholder_db_name => "/logstash_sqlite.db"
collection => "logs"
generateId => false
batch_size => 5000
}
}
filter {
}
output {
stdout {codec => rubydebug}
elasticsearch {
user => "elastic"
password => "homemaster1!"
hosts =>"localhost"
index => "mongodb_log"
}
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.