# How do i use external versions when using pipelines?

**URL:** <https://discuss.elastic.co/t/how-do-i-use-external-versions-when-using-pipelines/103981>\
**Category:** Elasticsearch\
**Created:** [October 14, 2017, 10:29am UTC](https://discuss.elastic.co/t/how-do-i-use-external-versions-when-using-pipelines/103981 "2017-10-14T10:29:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arian\_Dave\_Mabanag](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@Arian\_Dave\_Mabanag](https://discuss.elastic.co/u/Arian_Dave_Mabanag)\
**Post date:** [October 14, 2017, 10:29am UTC](https://discuss.elastic.co/t/how-do-i-use-external-versions-when-using-pipelines/103981/1 "2017-10-14T10:29:45Z")

</div>

Im currently working on pushing logs to elasticsearch using filebeat. In order to index these docs to the preferred location, i use an ingester node.

{"name":"mydoc","myDocId":"myId1","myDocType":"someType","myIndex":"someIndex","myVersion":1}

With this sample log, i use a series of processors to structure it. In one of the pipeline processors i use a script processor and do:

...  
ctx.\_index = ctx.myIndex; ctx.\_type=ctx.myType;  
...

This works but uses the internal version of elasticsearch. Since the doc contains a version of itself (myVersion field), i would like to use it so that i can make sure that an older version of what filebeat picks up does not override the doc if its an older one.

ive tried setting the ctx.\_version and addex ctx.\_version\_type=external but i get an error when i do so (dynamic mapping exception).

How do i use my own versioning sequence with the pipelines?

---

<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:** [November 11, 2017, 10:30am UTC](https://discuss.elastic.co/t/how-do-i-use-external-versions-when-using-pipelines/103981/2 "2017-11-11T10:30:18Z")

</div>

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