{"id":20801914,"url":"https://github.com/philips-software/logproxy-plugins","last_synced_at":"2025-05-07T00:45:48.792Z","repository":{"id":37863183,"uuid":"270219415","full_name":"philips-software/logproxy-plugins","owner":"philips-software","description":"Logproxy plugins","archived":false,"fork":false,"pushed_at":"2025-03-24T10:19:23.000Z","size":1299,"stargazers_count":4,"open_issues_count":18,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T02:16:55.724Z","etag":null,"topics":["logproxy","plugins"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philips-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-07T06:46:33.000Z","updated_at":"2025-03-24T10:19:26.000Z","dependencies_parsed_at":"2024-12-12T11:31:27.824Z","dependency_job_id":"18080ca6-08ac-4189-8e79-3db03ff8b13b","html_url":"https://github.com/philips-software/logproxy-plugins","commit_stats":{"total_commits":398,"total_committers":3,"mean_commits":"132.66666666666666","dds":"0.10050251256281406","last_synced_commit":"d2cd879b8c55bb6c49347265e83f9d8167611518"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Flogproxy-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Flogproxy-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Flogproxy-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips-software%2Flogproxy-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philips-software","download_url":"https://codeload.github.com/philips-software/logproxy-plugins/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793564,"owners_count":21805054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logproxy","plugins"],"created_at":"2024-11-17T18:26:09.976Z","updated_at":"2025-05-07T00:45:48.785Z","avatar_url":"https://github.com/philips-software.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logproxy plugins\nThis projects contains a number of [logproxy](https://github.com/philips-software/logproxy) plugins\n\nPlugins are compiled binaries running alongside the main logproxy process which manages the complete lifecycle. \nIt detects and loads any plugins found in the search paths. The \nmechanism is based on [Hashicorp's Go plugin system](https://github.com/hashicorp/go-plugin). Some use cases\nfor writing a plugin:\n\n- Dropping verbose or high frequency logs which are not interesting (saving costs)\n- Trigger events (e.g. send an email, call a webhook) when certain patterns in your logs are detected\n- Controlled forwarding of logs to other systems\n- Log enrichment e.g. by parsing fields or adding data from external systems\n\n## Plugin interface\nPlugins implement a single method  from the `Filter` interface\n\n```go\npackage main\n\nimport (\n  \"github.com/dip-software/go-dip-api/logging\"\n)\n\ntype Filter interface {\n    Filter(in logging.Resource) (out logging.Resource, drop bool, modified bool, err error)\n}\n```\n\nThe incoming Resource is a single log message. You can examine its content and decide to leave it as is, drop it, or make changes to various fields.\nSetting the `drop` boolean `true` to true will instruct Logproxy to\ndiscard the message without further processing. If the message\ncontains modifications set the `modified` boolean to `true` as well as \nreturning the modified message.\n\n## Note on aggregation in filters\nWhen you want to aggregate data (e.g. a counter) over a number of messages, or trigger events, keep in mind there\nmight be multiple Logproxy instances running, each with their own copy of the plugin running. \nYou will need to use a backing store service, e.g. Redis or PostgreSQL, to synchronize across instances. \n\n# Building and deploying your plugin\nThe quickest way to build and deploy your plugin is using a well crafted Dockerfile. We will build the plugin using Docker. \n\n# Naming\nYour plugin binary should follow the `logproxy-filter-*` glob naming convention. In future we might support other types of plugins.\n\n# Dockerfile\nWe use the official [Logproxy Docker image](https://hub.docker.com/r/philipssoftware/logproxy) as base and simply copy\nthe plugin binary to the app folder. When the image starts your plugin will be auto-detected. Example:\n\n```Dockerfile\nFROM golang:1.24.1-alpine3.20 as build_base\nRUN apk add --no-cache git openssh gcc musl-dev\nWORKDIR /plugin\nCOPY go.mod .\nCOPY go.sum .\n\n# Get plugin dependancies\nRUN go mod download\nLABEL builder=true\n\n# Build\nFROM build_base AS builder\nWORKDIR /plugin\nCOPY . .\nRUN go build .\n\nFROM philipssoftware/logproxy:latest\nCOPY --from=builder /plugin/logproxy-filter-myplugin /app\n```\n\nBuild and push your Docker image to a registry and you are now\nready to deploy. Please see the [Logproxy project](https://github.com/philips-software/logproxy) for\ndetails on the configuration, specifically the required ENV variables.\n\n# Contact / Getting help\n\nAndy Lo-A-Foe \u003candy.lo-a-foe@philips.com\u003e\n\n# License\n\nLicense is MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-software%2Flogproxy-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilips-software%2Flogproxy-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips-software%2Flogproxy-plugins/lists"}