Releases: philips-software/logproxy
Releases · philips-software/logproxy
v1.2.2
[NEW] Filter only mode
You may choose to operate Logproxy in Filter only mode. It will listen
for messages on the logdrain endpoints, run these through any active
filter plugins and then discard instead of delivering them to HSDP logging.
This is useful if you are using plugins for real-time processing only.
To enable filter only mode set LOGPROXY_DELIVERY to none
...
...
env:
LOGPROXY_DELIVERY: none
v1.2.1
v1.2.0
Whats new
- [NEW] Plugin support
- Much improved batch error handling
Plugins
This release brings a brand new feature, plugins. It is now possible to add external plugins which are independent Go processes connected via gRPC which get a chance to transform or drop each message passing through Logproxy. Use cases include:
- Dropping verbose or high frequency logs which are not interesting
- Trigger events (e.g. send an email, call a webhook) when certain patterns in your logs are detected
- Forwarding of logs to external systems
Below is a full working example of a plugin. It prints out the logging resource ID
package main
import (
"fmt"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-plugin"
"github.com/philips-software/go-hsdp-api/logging"
"github.com/philips-software/logproxy/shared"
)
type Filter struct{}
func (Filter) Filter(msg logging.Resource) (logging.Resource, bool, bool, error) {
hclog.Default().Info(fmt.Sprintf("Processed: %s", msg.ID))
return msg, false, false, nil
}
func main() {
plugin.Serve(&plugin.ServeConfig{
HandshakeConfig: shared.Handshake,
Plugins: map[string]plugin.Plugin{
"filter": &shared.FilterGRPCPlugin{Impl: &Filter{}},
},
GRPCServer: plugin.DefaultGRPCServer,
})
}