# Problem with mapping, upserts and multiple configs

**URL:** <https://discuss.elastic.co/t/problem-with-mapping-upserts-and-multiple-configs/31369>\
**Category:** Logstash\
**Created:** [September 29, 2015, 10:30pm UTC](https://discuss.elastic.co/t/problem-with-mapping-upserts-and-multiple-configs/31369 "2015-09-29T22:30:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![griddell](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@griddell](https://discuss.elastic.co/u/griddell)\
**Post date:** [September 29, 2015, 10:30pm UTC](https://discuss.elastic.co/t/problem-with-mapping-upserts-and-multiple-configs/31369/1 "2015-09-29T22:30:36Z")

</div>

Using:  
ES 1.7.1  
LS 1.5.4

I am trying the upsert feature and it does not work as I expected (but maybe my expectation is wrong). Here is what I am doing:

I created a mapping file for my elasticsearch index. (Let's say it has 10 fields.). I do a post against the index to create the mapping:

```auto
{ "mappings": {
        "well": {
            "_all": {
                "enabled": true
            },
            "properties": {
                        ... 10 fields detailed here ...
                       }
              }
       }
}

```

I am indexing my documents with logstash (coming in via the jdbc input) using multiple configs to do the import. (Let's say config1 brings in 5 fields, config2 brings in 3 fields, and config3 brings in 2 fields.) I know the document Id and use that across all the config files. I am needing these to be separate updates due to inconsistent updates of information in the different oracle tables.

Basically, Elasticsearch is my consolidated document.

I am using the following elasticsearch output conf for the three configs:

```auto
elasticsearch {
        host => "localhost"
        protocol => "http"
        index => "wells"
        action => "update"
        document_type => "well"
        document_id => "%{[master_well_interval_id]}"
        doc_as_upsert => true
        manage_template => false
    }

```

Now, what happens is, when the document gets updated by (let's use) config1, the mapping gets changed to only having those fields that were specified (i.e. for config1, that is 5 fields). The others get removed from the mapping (i.e. in this example, 5 fields).

If I remove the `action => "update"` part from the config, then the mapping stays as it was originally configured, but the document gets overritten each time a config updates that document.

So, is this working as advertised? I would expect my configuration to keep my mapping, but that is not what I am experiencing.

I remember seeing somewhere that update actions don't work against the http protocol, but I thought that was fixed in LS 1.5.4.

Any suggestions?

Thanks in advance!!  
Gerry.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:27am UTC](https://discuss.elastic.co/t/problem-with-mapping-upserts-and-multiple-configs/31369/2 "2017-07-06T05:27:44Z")

</div>


