{"id":26059692,"url":"https://github.com/orange-cloudfoundry/logs-service-broker","last_synced_at":"2026-01-06T17:20:24.942Z","repository":{"id":40349893,"uuid":"159709213","full_name":"orange-cloudfoundry/logs-service-broker","owner":"orange-cloudfoundry","description":"A logs service broker to forward logs to any syslog backend (http, tcp, or udp)","archived":false,"fork":false,"pushed_at":"2025-04-09T15:18:25.000Z","size":22052,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T16:30:22.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orange-cloudfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-11-29T18:22:02.000Z","updated_at":"2025-04-09T15:17:12.000Z","dependencies_parsed_at":"2023-10-12T06:39:05.923Z","dependency_job_id":"3b51f5d1-eb12-46d3-aca8-ab0e65662333","html_url":"https://github.com/orange-cloudfoundry/logs-service-broker","commit_stats":null,"previous_names":[],"tags_count":136,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orange-cloudfoundry%2Flogs-service-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orange-cloudfoundry%2Flogs-service-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orange-cloudfoundry%2Flogs-service-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orange-cloudfoundry%2Flogs-service-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orange-cloudfoundry","download_url":"https://codeload.github.com/orange-cloudfoundry/logs-service-broker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358548,"owners_count":21090401,"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":[],"created_at":"2025-03-08T13:27:47.364Z","updated_at":"2026-01-06T17:20:24.889Z","avatar_url":"https://github.com/orange-cloudfoundry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logs-service-broker\n\nLogs-service-broker is a broker server for logs parsing (with custom parsing patterns given by user or operator) and\nforwarding to one or multiple syslog endpoint in RFC 5424 syslog format.\nTake care that logs-service-broker will always provide json encoded format to final syslog endpoint(s).\n\nIt is for now tied to Cloud Foundry for different types of logs received by this platform.\n\nThis is compliant with the spec [open service broker api](https://www.openservicebrokerapi.org/) for\n[syslog drain](https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#log-drain).\n\n## How to deploy\n\nOn Cloud Foundry, a service should **not** be deployed from this source code, but it must use the boshrelease related to it\nwhich can be found here: https://github.com/orange-cloudfoundry/logservice-boshrelease/\n\n1. Clone the repo\n2. Go build the repo directly this will give you a logs-service-broker runnable server\n3. Create a `config.yml` file to set your configuration. Configuration is explained in the [configuration section](#configuration)\n\n## Configuration\n\nConfig format is explained in [config-sample.yml](./config-sample.yml).\n\n* `[mandatory]` tag means current key is mandatory\n* types must follow those given as example\n\n### .syslog_addresses configuration\n\n**Note**: Default grok patterns can be found at [parser/patterns.go](./parser/patterns.go) and [vendor/github.com/ArthurHlt/grok/patterns.go](./vendor/github.com/ArthurHlt/grok/patterns.go).\n\n#### .syslog_addresses.tags templating\n\nTags can be dynamically be formatted by using golang templating:\n```yaml\ntags:\n  my-tag: \"{{ .App }}-my-tag\"\n```\n\nThis example show how to suffix your tag `my-tag` by the app name for current log.\n\nYou have access to this data:\n- `Org`: Org name in current log\n- `OrgID`: Org id in current log\n- `Space`: Space name in current log\n- `SpaceID`: Space id in current log\n- `App`: App name in current log\n- `AppID`: App id in current log\n- `Logdata`: Final logs parsed as a `map[string]interface{}` (use `ret` function for easy exploring)\n\nIn addition, you can use those functions for helping you:\n- `split \u003cparam\u003e \u003cdelimiter\u003e`: Split string by a delimiter to get a slice\n- `join \u003cparam\u003e \u003cdelimiter\u003e`: Make string from a slice collapse by delimiter\n- `trimSuffix \u003cparam\u003e \u003csuffix\u003e`: Remove suffix from param\n- `trimPrefix \u003cparam\u003e \u003cprefix\u003e`: Remove prefix from param\n- `hasPrefix \u003cparam\u003e \u003cprefix\u003e`: Check if prefix exists in param\n- `hasSuffix \u003cparam\u003e \u003cprefix\u003e`: Check if suffix exists in param\n- `ret access.to.value.from.key`: Get the value of a key in a map by exploring it in dot format, e.g:\n  this `{\"foo\": {\"exists\": [\"my-value\"]}` can be done with `ret \"foo.exists.0\"`\n\n**tips**: on `ret` function you can use special key `first` and `last` on a slice for respectively the first value of a slice or the last one.\n\n### forwarder.parsing_key\n\nSome of the key/value pairs have special effect; those pairs defined will be used as parsing value until there is nothing to parse anymore, we call them parsing keys.\n\nBy default, parsing keys are:\n- `@message`\n- `@raw`\n- `text`\n\nBut as an operator you can provide more.\n\nHere the syntax to use for adding more parsing keys:\n```yaml\n# Name is the key name to add for parsing, you can chose sub key with this format:\n# inline.key.with.dot.separator\n# note that if you want to navigate in an array you can use index number in the format and/or last and first keyword to\n# get the last or the first element\nname: \u003cstring\u003e\n# If set to true, this will remove this key from final result and just let new parsed value from it\n[ hide: \u003cboolean\u003e ]\n```\n\nExample, you have the structure parsed as followed:\n```json\n{\n  \"foo\": {\n    \"bar\": [{\n      \"elem1\" : \"text need to be parsed with current patterns\"\n    }]\n  },\n  \"titi\": \"toto\"\n}\n```\n\nYou can define a parsing key as follows:\n\n```yaml\nparsing_keys:\n- name: foo.bar.0.elem1\n  hide: true\n```\n\nyou will receive this final json:\n```json\n{\n  \"@message\": \"text need to be parsed with current patterns\",\n  \"titi\": \"toto\"\n}\n```\n\n## How to use as a user\n\nAs documentation is tied to the configuration given by the operator. We will not provide full doc directly here.\n\nUser doc can be found when you have deployed logservice at http://\u003cyour logservice url\u003e/docs.\n\nFor now, subset of user doc can be found here: [user-doc.md](/user-doc.md)\n\n## Prometheus metrics\n\nThe broker provide metrics in prometheus format on the endpoint: https://my-logservice.com/metrics .\n\nYou can found dashboard for grafana here: https://github.com/orange-cloudfoundry/logservice-boshrelease/blob/master/jobs/logservice_dashboards/templates/logservice_overview.json\nAnd also alerts for it here: https://github.com/orange-cloudfoundry/logservice-boshrelease/blob/master/jobs/logservice_alerts/templates/logservice.alerts.yml\n\n## Architecture in a Cloud Foundry context\n\n[![archi](/docs/archi.png)](/docs/archi.png)\n\n\u003c!-- Local Variables: --\u003e\n\u003c!-- ispell-local-dictionary: \"american\" --\u003e\n\u003c!-- End: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forange-cloudfoundry%2Flogs-service-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forange-cloudfoundry%2Flogs-service-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forange-cloudfoundry%2Flogs-service-broker/lists"}