You can do something like this if you have multiple patterns;
filter {
grok { match => { "message" => [ "Duration: %{NUMBER:duration}", "Speed: %{NUMBER:speed}" ],
[ "Something: %{NUMBER:duration}", "Somethingelse: %{NUMBER:speed}" ],
[ "Foo: %{NUMBER:duration}", "Bar: %{NUMBER:speed}" ]
}
}
}