I would like to use a scripted field with a translation table to add a field from the the CMDB for a given host.
Here is an example Painless script adding a new scripted filed host_service
:
HashMap mapping = [
'gnu': 'webserver',
'matrix': 'fileserver'
];
mapping[doc['host.keyword'].value];
The only issue is that we don’t only have 2 servers but thousands so with this approach I hit the size limit of Painless scripts (https://github.com/elastic/elasticsearch/issues/23209). Is there any way to still define the mapping table, maybe load it from some other place? PS: Please, please make the limit configurable, as conquel argued. I know that Elasticsearch can pass parameters to Painless but this is not exposed in Kibana for scripted fields. Hacks are welcome other than recompiling Elasticsearch, it is still a production environment.