### 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> proc,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> sd,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> ts,
        Tuple<Map.Entry<String, GrokCaptureType>, Object> ver
    ) {
        String line = "<191>1 2009-06-30T18:30:00+02:00 paxton.local grokdebug 4123 - [id1 foo=\\\"bar\\\"][id2 baz=\\\"something\\\"] "
            + "Hello, syslog.";
        Grok grok = new Grok(Grok.getBuiltinPatterns(ecsCompatibility), "%{SYSLOG5424LINE}", logger::warn);
        assertCaptureConfig(
            grok,
            Map.ofEntries(app.v1(), host.v1(), msg.v1(), msgid.v1(), pri.v1(), proc.v1(), sd.v1(), ts.v1(), ver.v1())
        );
        Map<String, Object> matches = grok.captures(line);
        assertEquals(pri.v2(), matches.get(pri.v1().getKey()));
        assertEquals(ver.v2(), matches.get(ver.v1().getKey()));
        assertEquals(ts.v2(), matches.get(ts.v1().getKey()));
        assertEquals(host.v2(), matches.get(host.v1().getKey()));
        assertEquals(app.v2(), matches.get(app.v1().getKey()));
        assertEquals(proc.v2(), matches.get(proc.v1().getKey()));
        assertEquals(msgid.v2(), matches.get(msgid.v1().getKey()));
        assertEquals(sd.v2(), matches.get(sd.v1().getKey()));
        assertEquals(msg.v2(), matches.get(msg.v1().getKey()));
    }
    public void testDatePattern() {
        testDatePattern(false);
        testDatePattern(true);
    }
    private void testDatePattern(boolean ecsCompatibility) {
        String line = "fancy 12-12-12 12:12:12";
        Grok grok = new Grok(Grok.getBuiltinPatterns(ecsCompatibility), "(?<timestamp>%{DATE_EU} %{TIME})", logger::warn);