Trying to work out how to access an item in an ArrayList.
I have the values in _source:
"session_id" : [
"19a7ec8d",
"19a7ec8d"
],
As they are all duplicates (due to a faulty Grok script), I want to get rid of the duplicates:
I cannot workout how to access the value.
String old = ctx._source.session_id[0];
ctx._source.remove(\"session_id\");
ctx._source.session_id = old;
I have also tried:
String old = ctx._source.session_id.get(0);
String old = ctx._source.session_id.get(0).value()
String old = ctx._source.session_id[0].value()
String old = ctx._source.session_id.get(0).toString()
Thanks