# Transform not working in template

**URL:** <https://discuss.elastic.co/t/transform-not-working-in-template/31604>\
**Category:** Elasticsearch\
**Created:** [October 5, 2015, 4:47am UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604 "2015-10-05T04:47:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![notzippy](https://avatars.discourse-cdn.com/v4/letter/n/edb3f5/32.png) [@notzippy](https://discuss.elastic.co/u/notzippy)\
**Post date:** [October 5, 2015, 4:47am UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604/1 "2015-10-05T04:47:40Z")

</div>

Hi

I am having this issue were my transform is NOT making any changes to inserted documents. The script calls a python script. I have determined the following:

1. The script is called, print out of the ctx and it shows the full map of the document being inserted.
2. Any changes or additions to the document map are completely ignored

However if I call an update with the same transform block of code that was in the index template, the following is observed

1. The script is called, print out of the ctx and it shows the full map of the document being inserted.
2. Any changes or additions to the map are processed.

This appears to be occurring regardless of the language of the script, groovy behaves identically.

Any idea ?

Thanks  
Nz

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 5, 2015, 4:50am UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604/2 "2015-10-05T04:50:53Z")

</div>

If you can provide your code it could help 🙂

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 5, 2015, 5:11am UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604/3 "2015-10-05T05:11:06Z")

</div>

Just a note. We will probably remove that feature in the future. See [https://github.com/elastic/elasticsearch/pull/13657](https://github.com/elastic/elasticsearch/pull/13657)

---

<div class="post-metadata">

**Author:** ![notzippy](https://avatars.discourse-cdn.com/v4/letter/n/edb3f5/32.png) [@notzippy](https://discuss.elastic.co/u/notzippy)\
**Post date:** [October 5, 2015, 11:48am UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604/4 "2015-10-05T11:48:47Z")

</div>

@warkolm  
The code

```
{
"test": {
    "transform": {
        "lang": "python",
        "script_file": "python_test",
    },
  "properties": {
    "simple" : {
     "type":"string"
    }
}

```

python/test.py

```
ctx["_source"]["simple"] = "hello"

```

@dadoonet  
I really hope this does not get dropped, as pointed out in github there are cases were it makes sense to have this feature and to rip it out is rather defeating (at least the code that does this is now highlited and perhaps I can determine the issue). In my particular case I wanted to take long & lat data coming in as two seperate fields and transform it into a single field. To have logstash running for the sole purpose of transforming this field is a waste of CPU

Nz

---

<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 5, 2017, 11:46pm UTC](https://discuss.elastic.co/t/transform-not-working-in-template/31604/5 "2017-07-05T23:46:43Z")

</div>


