{"id":17676357,"url":"https://github.com/stylet/stdout-mq","last_synced_at":"2026-01-19T22:31:46.149Z","repository":{"id":43411724,"uuid":"241415711","full_name":"StyleT/stdout-mq","owner":"StyleT","description":"A transport for sending logs from stdout/stderr over MQ brokers","archived":false,"fork":false,"pushed_at":"2023-01-12T12:17:31.000Z","size":273,"stargazers_count":1,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T18:22:51.283Z","etag":null,"topics":["mq-broker","pino","pino-logs","pino-transport","rabbitmq"],"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/StyleT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-18T16:51:14.000Z","updated_at":"2024-01-24T01:53:52.000Z","dependencies_parsed_at":"2023-02-09T11:47:22.302Z","dependency_job_id":null,"html_url":"https://github.com/StyleT/stdout-mq","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyleT%2Fstdout-mq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyleT%2Fstdout-mq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyleT%2Fstdout-mq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyleT%2Fstdout-mq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StyleT","download_url":"https://codeload.github.com/StyleT/stdout-mq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608157,"owners_count":20965950,"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":["mq-broker","pino","pino-logs","pino-transport","rabbitmq"],"created_at":"2024-10-24T07:25:20.776Z","updated_at":"2026-01-19T22:31:46.122Z","avatar_url":"https://github.com/StyleT.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stdout-mq\n[![Build Status](https://travis-ci.com/StyleT/stdout-mq.svg?branch=master)](https://travis-ci.com/StyleT/stdout-mq)\n\nPino-mq will take all messages received on process.stdin and send them over a message bus using JSON serialization;\n\n## Installation\n\n```\nnpm install -g stdout-mq\n```\n\n## Quick Example\n\nBash pipes:\n```\nnode app.js 2\u003e\u00261 | stdout-mq -u \"amqp://guest:guest@localhost/\" -q \"pino-logs\"\n```\n\nVia sub-process, optimized for use with Docker:\n```\nstdout-mq -u \"amqp://guest:guest@localhost/\" -q \"pino-logs\" --spawnProcess=\"node app.js\"\n```\n\n## Command line switches\n\n- `--type` (`-t`): MQ type of transport to be used (default 'RABBITMQ')\n- `--uri` (`-u`): uri for connecting to MQ broker\n- `--queue` (`-q`): queue to be used for sending messages\n- `--fields` (`-f`): comma separated fields for filtering messages before sending\n- `--exchange` (`-e`): exchange name to be used in case of rabbitmq transport\n- `--config` (`-c`): path to config file (JSON); switches take precedence\n- `--generateConfig` (`-g`): create pino-mq.json config file with default options\n- `--help` (`-h`): display help\n- `--version` (`-v`): display version\n- `--wrapWith` (`-ww`): wrap a message with custom data where %DATA% will be replaced with a message e.g. `{\"data\": \"%DATA%\", \"customProp\": \"customData\"}`\n- `--spawnProcess` (`-sp`): Spawns a sub-process using specified command \u0026 listens it's stdout/stderr\n\n## Configuration JSON File\nby using `--generateConfig` it will create `pino-mq.json` file with all available configuration \noptions;\n\n```\n{\n \"type\": \"RABBITMQ\",\n \"uri\": \"amqp://guest:guest@localhost/\",\n \"exchange\": \"\",\n \"queue\": \"stdout-mq\",\n \"fields\": []\n}\n```\n\n## Broker connection\n* `uri` option will follow URI specification for defining connection to a host:\n\n    ```\n    \u003cprotocol\u003e://[user[:password]@]host[:port][/path][?query]\n    ```\n    where `protocol`, `path` and `fragment` will be specific for each type of broker\n\n## Configuration via environment variables\nYou may specify `MQ_PROTOCOL`, `MQ_LOGIN`, `MQ_PASSWORD`, `MQ_HOST` as env variables, these variables are going to be used to create URI for connecting to MQ broker, in this way, you can avoid using `--uri` (`-u`) param in CLI\n\n## Queues configuration\nqueue configuration has a priority in defining behaviour for stdout-mq; if more than one is specified, configuration will take this precedence:\n\n1. `queue` all messages will be sent on this queue\n\n#### RabbitMQ specific options\nFor RabbitMQ type there is an extra option: \n* `--exchange`: if you want to use a specific exchange for your queues or you want to use topics instead of queues than you have to pass it to pino-mq configuration; topics are a more powerful distribution mechanism than queues and explaining it is beyond the scope of this module ([RabbitMQ Topics tutorial](https://www.rabbitmq.com/tutorials/tutorial-five-javascript.html))\n\n\n## Fields filtering\nin case is needed to filter log messages fields you can use `fields` option:\n* from command line:\n    * `--fields \"time,level,msg\"`\n* from configuration json file:\n    * `\"fields\":[\"time\",\"level\",\"msg\"]`\n\n## LICENSE\n[Apache-2.0 License](https://github.com/StyleT/stdout-mq/blob/master/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstylet%2Fstdout-mq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstylet%2Fstdout-mq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstylet%2Fstdout-mq/lists"}