# Syntax issue with customized query

**URL:** <https://discuss.elastic.co/t/syntax-issue-with-customized-query/264899>\
**Category:** Elasticsearch\
**Created:** [February 19, 2021, 6:11pm UTC](https://discuss.elastic.co/t/syntax-issue-with-customized-query/264899 "2021-02-19T18:11:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shahsha\_21](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@Shahsha\_21](https://discuss.elastic.co/u/Shahsha_21)\
**Post date:** [February 19, 2021, 6:11pm UTC](https://discuss.elastic.co/t/syntax-issue-with-customized-query/264899/1 "2021-02-19T18:11:08Z")

</div>

I am trying to create a Boolean query which takes in user input(stored in a variable) and appends it with an existing string for e.g.  
User enters: "ABC" AND "CDE"  
which will be stored in a temporary variable: var input= "ABC" AND "CDE"  
and the query will look like:  
"query": input + "AND GHE" ("ABC" AND" CDE" AND GHE)

If I search it on Kibana the query would look like this in the link:'"ABC"%20AND%"CDE"%20AND%GHE' .This is giving me a syntax issue since the whole query needs to be enclosed within one pair of quotation marks. Any idea how I can query like this? I am a beginner to elk so any pointers/tips will be helpful.

---

<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:** [March 19, 2021, 6:11pm UTC](https://discuss.elastic.co/t/syntax-issue-with-customized-query/264899/2 "2021-03-19T18:11:19Z")

</div>

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