Hi All,
I'm trying to create new fields and corresponding value based on the values present in two different arrays while parsing the data in ingest node pipeline. For e.g., Array1 = [num1,num2] and Array2 = [10,20]
Expected output: num1 = 10, num2=20.
I'm trying to achieve this using script processor as shown below:
{"script": {
"lang": "painless",
"inline": "def source_fields = ctx.Array1;def target_fields = ctx.Array2 ;for(def i=0; i<source_fields.length; i++) {
ctx.Array1[i]= target_fields[i]; }"
}}
This one just changes the content or Array1 to [10,20]. Can you please help.
Thanks,
Ashish