# How to add characters to field containing the value to be compared for a match in translate pluging

**URL:** <https://discuss.elastic.co/t/how-to-add-characters-to-field-containing-the-value-to-be-compared-for-a-match-in-translate-pluging/201927>\
**Category:** Logstash\
**Created:** [October 2, 2019, 9:43am UTC](https://discuss.elastic.co/t/how-to-add-characters-to-field-containing-the-value-to-be-compared-for-a-match-in-translate-pluging/201927 "2019-10-02T09:43:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![namali](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@namali](https://discuss.elastic.co/u/namali)\
**Post date:** [October 2, 2019, 9:43am UTC](https://discuss.elastic.co/t/how-to-add-characters-to-field-containing-the-value-to-be-compared-for-a-match-in-translate-pluging/201927/1 "2019-10-02T09:43:09Z")

</div>

common filed of csv1 and csv2 is citycode, but citycode in csv2 file has additional character 'CV' in this scenario how to read csv2 from translate pluging. and also read csv3 to get out put index.

input csv files  
csv1  
hotelcode,citycode  
1001,301  
1002,302  
1003,302

csv2  
citycode,cityname,statecode  
CV301,Los Angeles,CA  
CV302, Nevada,LV

csv3  
statecode,statename  
CA,California  
LV,Las Vegas

output index should have  
hotelcode: 1002  
citycode: 302  
cityname: Nevada  
statename: Las Vegas

I tried as follows, can not add 'CV' to citycode from add\_tag and also cannot read csv3 file using statecode field from translate pluging.

add\_tag =\> {"citycode" =\> "CV\_%{citycode}" }

translate {  
destination =\> "[@metadata][state]"  
dictionary\_path =\> "/home/csv2.csv"  
field =\> "citycode" }  
dissect { mapping =\> { "[@metadata][state]" =\> "%{},%{cityname},%{statecode}" } }

---

<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:** [October 30, 2019, 9:43am UTC](https://discuss.elastic.co/t/how-to-add-characters-to-field-containing-the-value-to-be-compared-for-a-match-in-translate-pluging/201927/2 "2019-10-30T09:43:14Z")

</div>

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