Logstash doesnt update the data when mongodb data gets updated

I am using this configuration

input{
mongodb{
	uri=>"mongodb://localhost:27017/ebyat"
	placeholder_db_dir => "/opt/logstash-mongodb/"
	placeholder_db_name => "logstash_sqlite.db"
	collection => "amenities"
	batch_size => 5000
	dig_fields => ["property_ids"]
}
}
filter{
	mutate{
		remove_field=>["_id"]
	}
}
output{
	stdout{
		codec => rubydebug{
				metadata => true
			}
	}
	elasticsearch{
		action => "update"		
		index => "ebyat_amenities"
		hosts => ["localhost:9200"]
		document_id => "%{amenity}"
	}
}

Can anyone say what i am doing wrong?
Thanks In Advance

Try to change the document_id with this:

	elasticsearch{
		action => "update"		
		index => "ebyat_amenities"
		hosts => ["localhost:9200"]
		document_id => "%{property_ids}"
	}

Because if no more value for amenities the document will not added because the same document_id
If you use property_ids it means if new property_ids as your documents added, the document_id will create new one.

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