@jplopezy Look
OHHHHH i may have found a way using the _source
However, there are cases where retrieving fields from
_sourceis necessary. For example,textfields do not havedoc_valuesavailable by default, so you have to retrieve values from_source. In other instances, you might choose to disabledoc_valueson a specific field.
it will not be efficient and I would not recommend at scale...
Try this as the code in the runtime field
String username=grok('%{GREEDYDATA:leading_data}/CN=%{DATA:username}\'').extract(params._source.message)?.username;
if (username != null) emit(username);