# How to escape field values for elasticsearch filter query? Take 2

**URL:** <https://discuss.elastic.co/t/how-to-escape-field-values-for-elasticsearch-filter-query-take-2/131180>\
**Category:** Logstash\
**Created:** [May 9, 2018, 2:09pm UTC](https://discuss.elastic.co/t/how-to-escape-field-values-for-elasticsearch-filter-query-take-2/131180 "2018-05-09T14:09:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdmcalee](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jdmcalee](https://discuss.elastic.co/u/jdmcalee)\
**Post date:** [May 9, 2018, 2:09pm UTC](https://discuss.elastic.co/t/how-to-escape-field-values-for-elasticsearch-filter-query-take-2/131180/1 "2018-05-09T14:09:15Z")

</div>

Continuing the discussion from [How to escape field values for elasticsearch filter query?](https://discuss.elastic.co/t/how-to-escape-field-values-for-elasticsearch-filter-query/125386):

Sorry for disappearing on my previous question, I had to drop my work for a while. I do not understand the reply @magnusbaeck gave. What command line option is being referred to there? I don't see anything in the documentation or --help output that looks relevant.

To recap the important stuff here, I'm using this query:

```
query => "usernames.keyword:%{[userid]}@%{[domain]}"

```

and sometimes the userid field value is something like "n/a", and I get a lexical error because of the / character. The event is coming from the jdbc\_input plugin.

---

<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:** [June 6, 2018, 2:09pm UTC](https://discuss.elastic.co/t/how-to-escape-field-values-for-elasticsearch-filter-query-take-2/131180/2 "2018-06-06T14:09:21Z")

</div>

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