Index pattern names aggregating multiple names in to one index name

Kibana version : 7.17

Elasticsearch version : 7.17

APM Server version : 7.17

APM Agent language and version : java 1.8

Fresh install or upgraded from other version? fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. :-no

This behavior is something that I have not observed in the previous versions. I am importing my saved objects including the index pattern names from another set up to the current set up. I could see the scripted filed associated with the index pattern as well . But after sometime the index names changed from just "apm-" to a big index name "traces-apm,apm-,logs-apm,apm-,metrics-apm,apm-* " and all the scripted fields have disappeared..

How can I avoid this behavior ? Or am I supposed to recreate the entire scripted field once again

Any updates on this?