boolean checkIsDynamicIndex(String index) {
			final Matcher matcher = dynamicIndexPattern.matcher(index);
			int count = 0;
			while (matcher.find()) {
				count++;
			}
			if (count > 1) {
				throw new TableException(String.format("Chaining dynamic index pattern %s is not supported," +
					" only support single dynamic index pattern.", index));
			}
			return count == 1;
		}
Check general dynamic index is enabled or not by index pattern.
elasticsearch7/elasticsearch7-sink/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/index/IndexGeneratorFactory.java