{"id":18278186,"url":"https://github.com/log4js-node/logstashhttp","last_synced_at":"2025-04-05T04:31:02.136Z","repository":{"id":37832633,"uuid":"138654296","full_name":"log4js-node/logstashHTTP","owner":"log4js-node","description":"Logstash HTTP appender for log4js-node","archived":false,"fork":false,"pushed_at":"2024-01-31T10:33:33.000Z","size":676,"stargazers_count":13,"open_issues_count":5,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-09T17:10:00.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/log4js-node.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-06-25T21:57:04.000Z","updated_at":"2024-08-15T07:03:49.000Z","dependencies_parsed_at":"2024-06-18T18:43:11.601Z","dependency_job_id":"a046979d-1570-460c-ae01-4333baaf932d","html_url":"https://github.com/log4js-node/logstashHTTP","commit_stats":{"total_commits":53,"total_committers":5,"mean_commits":10.6,"dds":"0.41509433962264153","last_synced_commit":"5813472d47930c2a94aef1d60db12adf4b01e2bc"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4js-node%2FlogstashHTTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4js-node%2FlogstashHTTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4js-node%2FlogstashHTTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log4js-node%2FlogstashHTTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/log4js-node","download_url":"https://codeload.github.com/log4js-node/logstashHTTP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289382,"owners_count":20914463,"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":"2024-11-05T12:23:24.734Z","updated_at":"2025-04-05T04:30:57.079Z","avatar_url":"https://github.com/log4js-node.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logstash Appender (HTTP) for log4js-node\n\nThe logstash appenders for [log4js](https://log4js-node.github.io/log4js-node) send NDJSON formatted log events to [logstash](https://www.elastic.co/products/logstash) receivers. This appender uses HTTP to send the events (there is another logstash appender that uses [UDP](https://github.com/log4js-node/logstashUDP)).\n\n```bash\nnpm install log4js @log4js-node/logstash-http\n```\n\n## Configuration\n\n- `type` - `@log4js-node/logstash-http`\n- `url` - `string` - logFaces receiver servlet URL\n- `application` - `string` (optional) - used to identify your application's logs\n- `logChannel` - `string` (optional) - also used to identify your application's logs [but in a more specific way]\n- `logType` - `string` (optional) - used for the `type` field in the logstash data\n- `timeout` - `integer` (optional, defaults to 5000ms) - the timeout for the HTTP request.\n- `agent` - `http.Agent | https.Agent` (optional) - used to configure the requests being sent out if needed.\n\nThis appender will also pick up Logger context values from the events, and add them as `p_` values in the logFaces event. See the example below for more details.\n\n# Example (default config)\n\n```javascript\nlog4js.configure({\n  appenders: {\n    logstash: {\n      type: \"@log4js-node/logstash-http\",\n      url: \"http://localhost:9200/_bulk\",\n      application: \"logstash-log4js\",\n      logType: \"application\",\n      logChannel: \"node\",\n    },\n  },\n  categories: {\n    default: { appenders: [\"logstash\"], level: \"info\" },\n  },\n});\n\nconst logger = log4js.getLogger();\nlogger.addContext(\"requestId\", \"123\");\nlogger.info(\"some interesting log message\");\nlogger.error(\"something has gone wrong\");\n```\n\nThis example will result in two log events being sent to your `localhost:9200`. Both events will have a `context.requestId` property with a value of `123`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog4js-node%2Flogstashhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flog4js-node%2Flogstashhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog4js-node%2Flogstashhttp/lists"}