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}" } }