I am having logs in txt file contains fields below. I want to extract country code from mobile number and create (translate) into new field called country.
I checked with translate filter but not getting how to extract country code digits from mobile number field to use it on translate filter.
20 is the country code for Egypt,971 is the country code for bahrain.I want to do it for all country code.
Pls, suggest to me if it's doable for at least one country code so that it can translate for others and as all country codes are unique.
I took a different approach, using python script (phone number library) and enriching country code and country name fields to the index, as I am not well versed in ruby.
Country code, country name field is getting added successfully in index with 98% accuracy.
Cons-
enrichment process is slow as compared to docs in an index, ex- 400 docs/min is enrichment rate, total docs are around 1m docs are getting added in index every hr in the same quantity.
As a single doc is getting checked and updated at a time the speed is slow, I am checking with bulk API update of docs using es helpers and scroll API but didn't work out in the above script.
Any suggestion regarding the above will be highly helpful.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.