progrium/logspout — pull request #28 by nrocine (2014-11-12 01:47:14+00:00)
Title: Added a prefix matcher for routes.

We have a use-case for logspout where many of our containers have names that are postfixed with numbers or timestamped. The Name matcher for routes doesn't work because it is an exact name, and the ID matcher doesn't work because it requires us to know the container ID in advance of the route creation, and the filter matcher doesn't work because it only applies to the log content, not the final log that is sent to the destination.

The Prefix matcher works much like the Name matcher, you provide a string, and if a container generating an event starts with that string, the log is routed to the defined address. The following example would allow a container name "grafana-1" to be routed to "logs2.papertrailapp.com:11111"

`
{
"source": {
"prefix": "grafana"
},
"target": {
"type": "syslog",
"addr": "logs2.papertrailapp.com:11111"
}
}
`

Thanks for considering this request.