### Elasticsearch Version

7.17.6, 8.x

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

Doesn't depend on the OS Version

### Problem Description

The Grok processor in the elasticsearch ingest pipelines does not extract multiple value that match a group but only the first one.

For example the following Grok expression:
```
^%{IPORHOST:source.address} (%{IPORHOST:source.address} )?
```

when given the following input:
```
"127.0.0.1 127.0.0.2"
```

It should match both values and not only the first one.

### Steps to Reproduce

```
POST /_ingest/pipeline/_simulate
{
  "pipeline": {
    "description": "_description",
    "processors": [
      {
        "grok": {
          "field": "message",
          "patterns": [
            "^%{IPORHOST:source.address} (%{IPORHOST:source.address} )?"
          ]
        }
      }
    ]
  },
  "docs": [
    {
      "_index": "index",
      "_id": "id",
      "_source": {
        "message": "82.10.222.126 192.168.10.1"
      }
    }
  ]
}
```

The `source.addresses` in the response is:
```
{
  "docs": [
    {
      "doc": {
        "_index": "index",
        "_id": "id",
        "_version": "-3",
        "_source": {
          "message": "82.10.222.126 192.168.10.1",
          "apache": {
            "access": {
              "user": {
                "identity": "jean"
              }
            }
          },
          "source": {
            "address": "82.10.222.126"
          }
        },
        "_ingest": {
          "timestamp": "2022-12-01T09:10:24.439912308Z"
        }
      }
    }
  ]
}
```

While the expected value of `source.address` is:
```
{
  "docs": [
    {
      "doc": {
        "_index": "index",
        "_id": "id",
        "_version": "-3",
        "_source": {
          "message": "82.10.222.126 192.168.10.1",
          "apache": {
            "access": {
              "user": {
                "identity": "jean"
              }
            }
          },
          "source": {
            "address": [
              "82.10.222.126",
              "192.168.10.1"
            ]
          }
        },
        "_ingest": {
          "timestamp": "2022-12-01T09:10:24.439912308Z"
        }
      }
    }
  ]
}

### Logs (if relevant)

_No response_
libs/grok/src/test/java/org/elasticsearch/grok/GrokTests.java
Tuple<Map.Entry<String, GrokCaptureType>, Object> httpVersion,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> ident,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> rawRequest,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> referrer,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> request,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> timestamp,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> verb,
        List<Tuple<Map.Entry<String, GrokCaptureType>, Object>> additionalFields
    ) {
        String logLine = """
            31.184.238.164 - - [24/Jul/2014:05:35:37 +0530] "GET /logs/access.log HTTP/1.0" 200 69849 "http://8rursodiol.enjin.com" \
            "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.12785 YaBrowser/13.12.1599.12785 \
            Safari/537.36" "www.dlwindianrailways.com\"""";
        Grok grok = new Grok(Grok.getBuiltinPatterns(ecsCompatibility), "%{COMBINEDAPACHELOG}", logger::warn);
        Map<String, GrokCaptureType> captureTypes = new HashMap<>();
        captureTypes.put(agent.v1().getKey(), agent.v1().getValue());
        captureTypes.put(auth.v1().getKey(), auth.v1().getValue());
        captureTypes.put(bytes.v1().getKey(), bytes.v1().getValue());
        captureTypes.put(clientIp.v1().getKey(), clientIp.v1().getValue());
        captureTypes.put(httpVersion.v1().getKey(), httpVersion.v1().getValue());
        captureTypes.put(ident.v1().getKey(), ident.v1().getValue());
        captureTypes.put(rawRequest.v1().getKey(), rawRequest.v1().getValue());
        captureTypes.put(referrer.v1().getKey(), referrer.v1().getValue());
        captureTypes.put(request.v1().getKey(), request.v1().getValue());
        captureTypes.put(timestamp.v1().getKey(), timestamp.v1().getValue());
        captureTypes.put(verb.v1().getKey(), verb.v1().getValue());
        for (var additionalField : additionalFields) {
            captureTypes.put(additionalField.v1().getKey(), additionalField.v1().getValue());
        }
        assertCaptureConfig(grok, captureTypes);