# \[SOLVED\] Escape hyphen in Kibana

**URL:** <https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125>\
**Category:** Kibana\
**Created:** [April 12, 2016, 1:54pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125 "2016-04-12T13:54:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [April 12, 2016, 1:54pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/1 "2016-04-12T13:54:26Z")

</div>

Hi all,

Kibana version: 4.4.2

When I make a search in Kibana web interface, it doesn't work like excepted for string with hyphen character included.

**Example:**

Search: "test-10"  
Result: `test`-`10`

Search: test-10  
Result: `test`-10

Search: test\-10  
Result: `test`-10

Search: "test\-10"  
Result: `test`-`10`

As you can see, the hyphen is never catch in the result.

I made a TCPDUMP:

- Query format with not escape hyphen: @source\_host:"test-"

- Query format with escape hyphen: @source\_host:"test\\-"

So it escapes the "" character but not the hyphen character.

Do you know why ? Regarding [Apache Lucene documentation](https://lucene.apache.org/core/2_9_4/queryparsersyntax.html), it should be work.

Thanks in advance for your help !  
Alex

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [April 12, 2016, 5:09pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/2 "2016-04-12T17:09:50Z")

</div>

Hmm... Not sure if this makes any difference, but is the field you're searching analyzed?

---

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [April 16, 2016, 10:14am UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/3 "2016-04-16T10:14:27Z")

</div>

Hi,

Sorry, I took a long time to answer. But yes it is analyzed.

Thanks for your reply !

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [April 19, 2016, 6:22pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/4 "2016-04-19T18:22:36Z")

</div>

Do you have a `@source_host.raw` unanalyzed field? If not, you may need to add one to your mapping to be able to search the way you'd like.

---

<div class="post-metadata">

**Author:** ![axelfelix](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@axelfelix](https://discuss.elastic.co/u/axelfelix)\
**Post date:** [April 20, 2016, 2:25pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/5 "2016-04-20T14:25:11Z")

</div>

Thanks I will try.

---

<div class="post-metadata">

**Author:** ![shiva\_ram](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@shiva\_ram](https://discuss.elastic.co/u/shiva_ram)\
**Post date:** [April 21, 2017, 12:45pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/6 "2017-04-21T12:45:57Z")

</div>

May I know how this is marked as SOLVED ?

I'm still observing this issue and could not see a solution in this thread?

---

<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:** [July 6, 2017, 1:32pm UTC](https://discuss.elastic.co/t/solved-escape-hyphen-in-kibana/47125/7 "2017-07-06T13:32:10Z")

</div>


