# Elastic search look up filter is not working when the fields has special characters

**URL:** <https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960>\
**Category:** Logstash\
**Created:** [November 22, 2024, 2:47pm UTC](https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960 "2024-11-22T14:47:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)\
**Post date:** [November 22, 2024, 2:47pm UTC](https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960/1 "2024-11-22T14:47:16Z")

</div>

Hi Team,

I am trying to compare data in two indexes using a common key which has special character "/" in the value.

For example: Common\_key: pr/01/1235678

When i use Elasticsearch filter in logstash to look up using common\_key i am getting elastic look up failure. Could you please let me know how can i look up using common\_key filed as all the values in the common\_key will be in the same format as mentioned above.

My logstash pipeline:  
input {  
elasticsearch {  
cloud\_id =\> "xxxxxxxxxxxxxxxxxxxx"  
proxy =\> "xxxxxxxxxxxxxxx"  
index =\> "index1"  
query =\> '{"query": {"match\_phrase": {"name": "amazon"}}}'  
ssl =\> true  
user =\> "xxxxxxxxxx"  
password =\> "xxxxxxxxxxxxx"  
}  
}

filter {  
elasticsearch {  
cloud\_id =\> "xxxxxxxxxxxxxxx"  
proxy =\> "xxxxxxxxxxxxxxxx"  
index =\> "index2"  
query =\> "common\_key:%{[common\_key]}"  
ssl =\> true  
user =\> "xxxxxxxxxxxxx"  
password =\> "xxxxxxxxxxxxxxxxxx"  
fields =\> {  
"[source]" =\> "[source]"  
"[price]" =\> "[price]"  
"[shop]" =\> "[shop]"  
}  
}  
}

output {  
stdout {  
codec =\> rubydebug  
}  
elasticsearch {  
cloud\_id =\> "xxxxxxxxxxxx"  
proxy =\> "xxxxxxxxxxxx"  
index =\> "index3"  
ssl =\> true  
user =\> "xxxxxxxxxxxx"  
password =\> "xxxxxxxxxxx"  
action =\> "create"  
}  
}

Thankyou in advance.

---

<div class="post-metadata">

**Author:** ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)\
**Post date:** [November 22, 2024, 6:06pm UTC](https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960/2 "2024-11-22T18:06:39Z")

</div>

Can someone please help me here

---

<div class="post-metadata">

**Author:** ![Hemanth\_Gowda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hemanth_gowda/32/23886_2.png) [@Hemanth\_Gowda](https://discuss.elastic.co/u/Hemanth_Gowda)\
**Post date:** [November 22, 2024, 6:27pm UTC](https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960/3 "2024-11-22T18:27:36Z")

</div>

You might have to escape the / before passing it to filter. Can you post the complete error message.

---

<div class="post-metadata">

**Author:** ![venkatkumar229](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatkumar229/32/104663_2.png) [@venkatkumar229](https://discuss.elastic.co/u/venkatkumar229)\
**Post date:** [November 22, 2024, 6:40pm UTC](https://discuss.elastic.co/t/elastic-search-look-up-filter-is-not-working-when-the-fields-has-special-characters/370960/4 "2024-11-22T18:40:51Z")

</div>

Hi @Hemanth_Gowda,

I am not getting any error but after processing i could see the tags having value of "elastic look up failure".

If i pass the field common key from source with escape characters will it solvey problem like buy using gsub.

Thankyou in advance.
