I am currently using kibana version 5.6.
I would like to
- search the position of string in a field and then
- extract the substring from the field
- show to value on "Discover"
Code Example:
def x = doc["description"].value
if (x != null) {
int pos = x.indexof("start")
if (pos > 0) {
return x.substring(pos, 20)
}
}
return "not found"
currently, pos is alway 0.