hding
June 22, 2017, 8:54pm
1
I'm trying to access array element after splitting a string into array using a 'split' processor in an ingest node pipeline?
I have a long string separated by slash ('/'). I only want to pass one substring to index, and dump the rest.
For example, I have a string "/aaa/bbb/ccc". I only want to index "ccc".
My current idea is to use split + set + remove, but I don't know how to access the array element after splitting.
hding
June 23, 2017, 1:01pm
2
It looks to me there has to be a solution. But I can't find it anywhere.
I've tried {{array}}[3], {{array[3]}}, {{array}[3]}, {{array}}.values[3], doc['array'].values[3]. None of them works.
rjernst
(Ryan Ernst)
June 26, 2017, 9:40pm
3
Try using a script processor. Your script could look something like this (eg for the first element):
"script": "ctx._source['myfield'] = ctx._source['myfield'].split('/')[0]"
system
(system)
Closed
July 25, 2017, 12:43pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.