# How to look for string '\\user' using query\_string

**URL:** <https://discuss.elastic.co/t/how-to-look-for-string-user-using-query-string/151114>\
**Category:** Elasticsearch\
**Created:** [October 4, 2018, 7:44pm UTC](https://discuss.elastic.co/t/how-to-look-for-string-user-using-query-string/151114 "2018-10-04T19:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucas.alvarez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lucas.alvarez/32/33649_2.png) [@lucas.alvarez](https://discuss.elastic.co/u/lucas.alvarez)\
**Post date:** [October 4, 2018, 7:44pm UTC](https://discuss.elastic.co/t/how-to-look-for-string-user-using-query-string/151114/1 "2018-10-04T19:44:30Z")

</div>

Hello everybody!. I have tried for an hour a way to look for '\user' inside of a message and I cannot make it work.

I know this can be easily done using the match\_phrase command, but since I'm using ElastAlert I must use 'query\_string'.

This is my query:

> GET my-index/\_search  
> {  
> "query": {  
> "query\_string" : {  
> "query" : "(message: \u)",  
> "default\_operator": "AND"  
> }  
> }  
> }

This is the error I get every time:

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "parse\_exception",  
> "reason": "parse\_exception: Truncated unicode escape sequence."  
> }  
> ],  
> "type": "search\_phase\_execution\_exception",  
> "reason": "all shards failed",  
> "phase": "query",  
> "grouped": true,  
> "failed\_shards": [  
> {  
> "shard": 0,  
> "index": "my-index-2018.10.04",  
> "node": "58KThwdwSaC1sxYV6kU3ZQ",  
> "reason": {  
> "type": "query\_shard\_exception",  
> "reason": "Failed to parse query [(message: \u)]",  
> "index\_uuid": "d0z9xK3cR8O4XCWNmoYP7A",  
> "index": "winlogwmi-2018.10.04",  
> "caused\_by": {  
> "type": "parse\_exception",  
> "reason": "parse\_exception: Cannot parse '(message: \u)': Truncated unicode escape sequence.",  
> "caused\_by": {  
> "type": "parse\_exception",  
> "reason": "parse\_exception: Truncated unicode escape sequence."  
> }  
> }  
> }  
> }  
> ],  
> "caused\_by": {  
> "type": "parse\_exception",  
> "reason": "parse\_exception: Truncated unicode escape sequence."  
> }  
> },  
> "status": 400  
> }

---

<div class="post-metadata">

**Author:** ![lucas.alvarez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lucas.alvarez/32/33649_2.png) [@lucas.alvarez](https://discuss.elastic.co/u/lucas.alvarez)\
**Post date:** [October 4, 2018, 7:47pm UTC](https://discuss.elastic.co/t/how-to-look-for-string-user-using-query-string/151114/2 "2018-10-04T19:47:42Z")

</div>

I have tried the following combinations: '\u', '@\u'.

None of them work :(.

---

<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:** [November 1, 2018, 7:47pm UTC](https://discuss.elastic.co/t/how-to-look-for-string-user-using-query-string/151114/3 "2018-11-01T19:47:44Z")

</div>

Closed on November 1, 2018, 7:47pm UTC

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