# How to access simple input field from search input

**URL:** https://discuss.elastic.co/t/how-to-access-simple-input-field-from-search-input/156787
**Category:** Elasticsearch
**Created:** [November 15, 2018, 5:54am UTC](https://discuss.elastic.co/t/how-to-access-simple-input-field-from-search-input/156787 "2018-11-15T05:54:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dogface](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dogface](https://discuss.elastic.co/u/dogface)
#### Post date: [November 15, 2018, 5:54am UTC](https://discuss.elastic.co/t/how-to-access-simple-input-field-from-search-input/156787/1 "2018-11-15T05:54:38Z")

</div>

I am trying to construct a watcher that uses the strings defined in the simple input section and places them into the search input section so I can rapidly create multiple watchers by only having to change the simple input section. In my json, I pass in the simple inputs into the parameters of my search template but it interprets it literally as a string. How can I force it to substitute the variable as the query? Below is example json of my watcher where I try and pass in the simple inputs:

//my Watcher JSON

"input": {  
"chain": {  
"inputs": [  
{  
"first": {  
"simple": {  
"process": "java"  
}  
}  
},  
{  
"second": {  
"search": {  
"request": {  
"search\_type": "query\_then\_fetch",  
"indices": [  
"metricbeat-2018-11-13"  
],  
"types": ,  
"template": {  
"id": "Template",  
"params": {  
"ctx\_payload\_first\_process": "{{ctx.payload.first.process}}"  
}  
}  
}  
}  
}  
}  
]  
}  
},

When I run the above code, it interprets it as {{ctx.payload.first.process}} and not java

---

<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: [December 13, 2018, 5:54am UTC](https://discuss.elastic.co/t/how-to-access-simple-input-field-from-search-input/156787/2 "2018-12-13T05:54:41Z")

</div>

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