If you have multiple Grok patterns then Grok will try to match against them in the order which they appear in the config file. As soon as one is matched the filter finishes. break_on_match is set to true by default and this is its behaviour.
However, if you set break_on_match to false then Grok will attempt all patterns no matter what. If the first pattern matches then it will still continue to match all the others you may have defined too. It just allows more flexibility.
As an example, say you had some user data like:
James Bond, MI5 Spy
You could have the following Grok filter to extract all the data you need in one go:
grok {
match => {
"message" => [
"%{GREEDYDATA:full_name}, %{GREEDYDATA:occupation}",
"%{WORD:first_name} %{WORD:last_name},"
]
}
break_on_match => false
}
That would pull out full_name, first_name, last_name and occupation all in one Grok as it would do the 2nd pattern even after the first one has matched.