# How to use output tuple values from tail pipe as parameters in Elasticsearch script?

**URL:** <https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [March 18, 2016, 2:11pm UTC](https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844 "2016-03-18T14:11:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andresg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andresg/32/8514_2.png) [@andresg](https://discuss.elastic.co/u/andresg)\
**Post date:** [March 18, 2016, 2:11pm UTC](https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844/1 "2016-03-18T14:11:27Z")

</div>

Hi all

I'm working with Cascading and ES-Hadoop connector, using an Hfs source and an ES sink on a Hadoop2MR1FlowConnector with following properties:

```
props.setProperty(ConfigurationOptions.ES_WRITE_OPERATION, ConfigurationOptions.ES_OPERATION_UPSERT);
props.setProperty(ConfigurationOptions.ES_UPDATE_SCRIPT, esUpdateScript);
props.setProperty(ConfigurationOptions.ES_UPDATE_SCRIPT_LANG, "groovy");

new Hadoop2MR1FlowConnector(props).connect(hfsTap, esTap, tailPipe).complete();

```

I see there is a config option to set script parameters: `ConfigurationOptions.ES_UPDATE_SCRIPT_PARAMS_JSON`

My question is, How can I use output tuple values (from tailPipe) as parameters in the groovy script?

Thanks

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [March 21, 2016, 10:48am UTC](https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844/2 "2016-03-21T10:48:09Z")

</div>

If you want to know more about the various configuration options you can:

1. look at the official reference [docs](https://www.elastic.co/guide/en/elasticsearch/hadoop/master/configuration.html#cfg-update)
2. if looking at the sources, take a look at the test suite

Note that the params are static - they can either be constant values or extracted from the document passed to ES.  
If your tuple is passed as the sink/tap to be written, then one can extract it from it - if not, then you'll have to device your own custom solution.

---

<div class="post-metadata">

**Author:** ![andresg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andresg/32/8514_2.png) [@andresg](https://discuss.elastic.co/u/andresg)\
**Post date:** [March 21, 2016, 12:41pm UTC](https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844/3 "2016-03-21T12:41:22Z")

</div>

@costin thanks!

---

<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, 1:25pm UTC](https://discuss.elastic.co/t/how-to-use-output-tuple-values-from-tail-pipe-as-parameters-in-elasticsearch-script/44844/4 "2017-07-06T13:25:36Z")

</div>


