{"id":22059220,"url":"https://github.com/opentable/logstash-redis","last_synced_at":"2025-07-24T00:31:41.147Z","repository":{"id":14941949,"uuid":"17666523","full_name":"opentable/logstash-redis","owner":"opentable","description":"Uber simple Logstash logging using Redis","archived":true,"fork":false,"pushed_at":"2015-09-23T07:33:29.000Z","size":157,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-07-07T11:16:21.850Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentable.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}},"created_at":"2014-03-12T12:42:07.000Z","updated_at":"2025-03-17T10:35:19.000Z","dependencies_parsed_at":"2022-08-30T11:32:35.722Z","dependency_job_id":null,"html_url":"https://github.com/opentable/logstash-redis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opentable/logstash-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Flogstash-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Flogstash-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Flogstash-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Flogstash-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentable","download_url":"https://codeload.github.com/opentable/logstash-redis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Flogstash-redis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266774717,"owners_count":23982246,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-30T17:27:34.982Z","updated_at":"2025-07-24T00:31:40.823Z","avatar_url":"https://github.com/opentable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"logstash-redis\n=============\n\nUber simple Logstash logging using a Redis list as input.\n\nNode version: **0.8.0** required\n\nBuild status: [![Build Status](https://secure.travis-ci.org/opentable/logstash-redis.png?branch=master)](http://travis-ci.org/opentable/logstash-redis)\n\n[![NPM](https://nodei.co/npm/logstash-redis.png?downloads=true)](https://npmjs.org/package/logstash-redis)\n\n# Installation\n\n```shell\nnpm install logstash-redis\n```\n\n# Usage\n\nThe simple way:\n```js\nvar logstashRedis = require('logstash-redis');\n\nvar logger = logstashRedis.createLogger('127.0.0.1', 6379, 'listName');\n\nlogger.log({ a: 1234, b: 'hello' });\n\nlogger.close();\n```\n\nUsing a base object for each log:\n```js\nvar logstashRedis = require('logstash-redis');\n\nvar baseObject = {\n  type: 'someValue',\n  env: \"prod-1234\"\n};\n\nvar logger = logstashRedis.createLogger('127.0.0.1', 6379, 'listName', baseObject);\n\nlogger.log({ a: 1234, b: 'hello' });\n\nlogger.close();\n```\n\nUsing a base function for each log:\n```js\nvar logstashRedis = require('logstash-redis');\n\nvar baseFunction = function(){\n  return  {\n    type: 'someValue',\n    meta: {\n      timestamp: new Date().toISOString(),\n      host: require('os').hostname()\n    }\n  };\n};\n\nvar logger = logstashRedis.createLogger('127.0.0.1', 6379, 'listName', baseFunction);\n\nlogger.log({ a: 1234, b: 'hello' });\n\nlogger.close();\n```\n\n# API\n\n### createLogger(host, port, key, [base])\n\nInitiate a Redis connection using a specific list. When the `base` parameter is specified, it is used as a base for each log object. It can be an object or a function.\n\n### logger.log(data, [callback])\n\nLogs some data asynchronously. Data is a valid javascript object. If a base object or function had been provided during initialisation, data will extend it.\n\n### logger.onError(fn)\n\nSubscribes a function `fn` to the error event. When the error will happen `fn` will be executed with some error details as parameter.\n\n### logger.close([callback]);\n\nCleanly closes the Redis connection (all replies will be parsed).\n\n# The NullLogger\n\nIt does exactly nothing. Good for testing.\n```js\nvar logstashRedis = require('logstash-redis');\n\nvar logger = logstashRedis.createNullLogger();\n\nlogger.log({ a: 1234, b: 'hello' });\n// does nothing\n\nlogger.close();\n// does nothing\n```\n\n# Tests\n\n```shell\nnpm test\n```\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Flogstash-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentable%2Flogstash-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Flogstash-redis/lists"}