logstash-plugins / logstash-input-couchdb_changes

This plugin captures the _changes stream from a CouchDB instance
Apache License 2.0
27 stars 22 forks source link

introduced new config 'keep_id' #31

Closed YannRobert closed 8 years ago

YannRobert commented 8 years ago

introduced new config 'keep_id' that allows to keep the '_id' field in the document, just like the 'keep_revision' config allows to keep the '_rev' field

untergeek commented 8 years ago

I'm puzzled. Why would you want this? Elasticsearch will already have the _id as part of the document. You want to have this data duplicated?

YannRobert commented 8 years ago

Yes, I want to get the same document from ElasticSearch as the one I get from CouchDB.

I need to be able to map (unmarshall) a JSON document to the same application's model Object (Java language) the same way whether I get it from ElasticSearch or CouchDB.

I could workaround with :

filter {
  mutate {
    add_field => { "[doc][_id]" => "%{[@metadata][_id]}" }
  }
}

but it's unnatural to remove a field just to re-add it after.

Since we have a config to 'keep_revision', it seems natural to have a config for 'keep_id'.

Does this sound reasonable?

elasticsearch-release commented 8 years ago

Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'.