### Elasticsearch Version

8.8.1

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

ESS

### Problem Description

The `reroute` processor allows to specific Mustache like syntax for field references. In contrast to other processors (.e.g `set` or `rename`) the variable does not allow to include spaces between the field name and the curly brackets.

This doesn't work:
```
"dataset": "{{ _reroute.dataset }}"
```
while this does:
```
"dataset": "{{_reroute.dataset}}"
```


### Steps to Reproduce

```
PUT _ingest/pipeline/reroute_example
{
  "processors": [
    {
      "reroute": {
        "tag": "example",
        "dataset": "{{ _reroute.dataset }}"
      }
    }
  ]
}

POST logs-test.original-default/_doc?pipeline=reroute_example
{
  "_reroute": {
    "dataset": "test.reroute"
  },
  "@timestamp": "2023-06-20"
}
```

Notice how the target Data Stream is `logs-test.original-default` instead of `logs-test.reroute-default`

### Logs (if relevant)

_No response_
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/RerouteProcessor.java
private static final int MAX_LENGTH = 100;
        private static final String REPLACEMENT = "_";
        private static final Pattern DISALLOWED_IN_DATASET = Pattern.compile("[\\\\/*?\"<>| ,#:-]");
        private static final Pattern DISALLOWED_IN_NAMESPACE = Pattern.compile("[\\\\/*?\"<>| ,#:]");
        static final DataStreamValueSource DATASET_VALUE_SOURCE = dataset("{{" + DATA_STREAM_DATASET + "}}");
        static final DataStreamValueSource NAMESPACE_VALUE_SOURCE = namespace("{{" + DATA_STREAM_NAMESPACE + "}}");
        private final String value;
        private final String fieldReference;
        private final Function<String, String> sanitizer;
        public static DataStreamValueSource dataset(String dataset) {
            return new DataStreamValueSource(dataset, ds -> sanitizeDataStreamField(ds, DISALLOWED_IN_DATASET));
        }
        public static DataStreamValueSource namespace(String namespace) {
            return new DataStreamValueSource(namespace, nsp -> sanitizeDataStreamField(nsp, DISALLOWED_IN_NAMESPACE));
        }
        private static String sanitizeDataStreamField(String s, Pattern disallowedInDataset) {
            if (s == null) {
                return null;
            }
            s = s.toLowerCase(Locale.ROOT);
            s = s.substring(0, Math.min(s.length(), MAX_LENGTH));
            return disallowedInDataset.matcher(s).replaceAll(REPLACEMENT);
        }
        private DataStreamValueSource(String value, Function<String, String> sanitizer) {
            this.sanitizer = sanitizer;
            this.value = value;
            if (value.contains("{{") || value.contains("}}")) {