# How to escape forward slashes in a query\_string query?

**URL:** <https://discuss.elastic.co/t/how-to-escape-forward-slashes-in-a-query-string-query/165397>\
**Category:** Elasticsearch\
**Created:** [January 23, 2019, 11:56am UTC](https://discuss.elastic.co/t/how-to-escape-forward-slashes-in-a-query-string-query/165397 "2019-01-23T11:56:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gchermennov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gchermennov/32/10471_2.png) [@gchermennov](https://discuss.elastic.co/u/gchermennov)\
**Post date:** [January 23, 2019, 11:56am UTC](https://discuss.elastic.co/t/how-to-escape-forward-slashes-in-a-query-string-query/165397/1 "2019-01-23T11:56:24Z")

</div>

Can't seem to get easy query to work, I assume it's due to slashes in the url:  
{  
"size": 100,  
"query": {  
"bool": {  
"must": [  
{ "range" : { "@timestamp" : { "gte": "01-07-2018", "lt": "31-12-2018", "format": "dd-MM-yyyy" } } },  
{ "query\_string": { "default\_field": "url", "query": "/api/v1/users/recent" } },  
{ "term": { "inner.request.method": "GET" } }  
]  
}  
},  
"sort": { "@timestamp": { "order": "desc" } }  
}  
Tried one single and double backslashes, keyword analyzer - doesn't seem to help

---

<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:** [February 20, 2019, 11:56am UTC](https://discuss.elastic.co/t/how-to-escape-forward-slashes-in-a-query-string-query/165397/2 "2019-02-20T11:56:26Z")

</div>

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