Extracting Substrings Using Runtime Fileds


With runtime fields, is it possible to extract a substring from a given field? For example,

"url" : "https://hello.com/random?username"

How would I create a runtime field to grab the "username" string ?

Hi @hi_xavier

For the time being some string manipulation will do it, but there's a proposal to add a URL parser to Painless which will make it safer:

emit(url.substring(url.indexOf('?') + 1));

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.