Dynamic rename a field name

We want to index lab results in Elasticsearch. Because result readouts can be numeric, string or date. And the readouts of different lab results can be dynamic. So in logstash, we prefix the readouts with either 'numberic_' or 'string_' so that we can define a dynamic template to match types to prefixes. However, we still like to use the original readout name when indexing the readouts. Is there a way to dynamic rename the readout names, i.e. to remove the prefix we added in logstash?

Take a look at the reindex api. You can use that in combination with a reindex script to remap fields into different fieldnames.

Thank you for your reply. Because we can have new lab result type with new readout (properties) quite often. That is the reason we use dynamic template. Using reindex, we may have to reindex whenever a new type of lab result is indexed, and may have to be manual.

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