{"id":16865991,"url":"https://github.com/lukemathwalker/bunyan","last_synced_at":"2025-04-06T03:09:37.389Z","repository":{"id":45706182,"uuid":"304442497","full_name":"LukeMathWalker/bunyan","owner":"LukeMathWalker","description":"A CLI to pretty print logs in bunyan format. A Rust port of the original JavaScript bunyan CLI.","archived":false,"fork":false,"pushed_at":"2023-12-10T12:25:05.000Z","size":330,"stargazers_count":98,"open_issues_count":4,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T00:04:08.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/LukeMathWalker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","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-10-15T20:37:24.000Z","updated_at":"2025-02-02T11:53:58.000Z","dependencies_parsed_at":"2024-10-26T21:16:35.716Z","dependency_job_id":"a713d101-39cb-4c42-b2a9-0271d6c376b7","html_url":"https://github.com/LukeMathWalker/bunyan","commit_stats":{"total_commits":76,"total_committers":11,"mean_commits":6.909090909090909,"dds":"0.21052631578947367","last_synced_commit":"e3362cb045e207f8333eb7cd4c725a78566da331"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeMathWalker%2Fbunyan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeMathWalker%2Fbunyan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeMathWalker%2Fbunyan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeMathWalker%2Fbunyan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeMathWalker","download_url":"https://codeload.github.com/LukeMathWalker/bunyan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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-10-13T14:49:06.288Z","updated_at":"2025-04-06T03:09:37.345Z","avatar_url":"https://github.com/LukeMathWalker.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ebunyan-rs\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n \u003cstrong\u003e\n   A Rust port of \u003ca href=\"https://github.com/trentm/node-bunyan\" target=\"_blank\"\u003enode-bunyan\u003c/a\u003e.\n \u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Crates version --\u003e\n  \u003ca href=\"https://crates.io/crates/bunyan\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/bunyan.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/bunyan\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/bunyan.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n\u003e _Structured logs are the greatest thing since sliced bread._\n\nAre you annoyed from having to install `npm` just to get a copy of the amazing [NodeJS bunyan CLI](https://github.com/trentm/node-bunyan) to pretty-print your logs?  \n\nI feel you!\n\nThat's why I wrote `bunyan-rs`, a Rust port of (a subset of) the original [NodeJS bunyan CLI](https://github.com/trentm/node-bunyan).  \n\n\u003cdiv\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/LukeMathWalker/bunyan/main/images/ConsoleBunyanOutput.png\" /\u003e\n\u003c/div\u003e\n\u003chr/\u003e\n\n# Table of Contents\n0. [How to install](#how-to-install)\n1. [How to use](#how-to-use)\n2. [Limitations](#limitations)\n3. [Bunyan ecosystem in Rust](#bunyan-ecosystem-in-rust)\n4. [Benchmarks](#benchmarks)\n5. [License](#license)\n\n## How to install\n\nUsing `cargo`:\n```bash\ncargo install bunyan\n```\n\nYou can verify your installation with\n```bash\nbunyan --help\n```\n\nAlternatively, you can download a pre-built binary for your operating system from the [latest release](https://github.com/LukeMathWalker/bunyan/releases).\n\n## How to use\n\n`bunyan-rs` only supports stdin as input source.\n\nYou can pipe a log file into it:\n```bash\ncat tests/all/corpus/all.log | bunyan\n```\n\nOr you can pipe the output of a long-running job into it:\n```bash\n# Tail logs from a Docker container\ndocker logs -f my-app | bunyan\n\n# Tail logs from a Kubernetes pod using kubectl\nkubectl logs -f my-app-asdadf-cvcvcv\n\n# Tail logs from a group of Kubernetes pods using stern\nstern \"my-app\" --output raw --tail 100 | bunyan\n```\n\n## Limitations\n\nCompared to the original `bunyan` CLI, `bunyan-rs`:\n\n- Only supports `stdin` as input source (no files);\n- Does not support log snooping via DTrace (`-p` argument);\n- Does not support the `-c/--condition` filtering mechanism;\n- Does not support the `--pager/--no-pager` flags;\n- Only supports the `long` output format;\n- Only supports UTC format for time.\n\nSome of the above might or might not be added in the future.  \nIf you are interested in contributing, please open an issue.\n\n## Bunyan ecosystem in Rust\n\nYou are writing a Rust application and you'd like to emit logs in bunyan format - what can you use?\n\nCheck out the following crates:\n\n- [`tracing-bunyan-formatter`](https://crates.io/crates/tracing-bunyan-formatter), a bunyan formatter for [`tracing`](https://crates.io/crates/tracing);\n- [`slog-bunyan`](https://crates.io/crates/slog-bunyan), a bunyan formatter for [`slog`](https://crates.io/crates/slog).\n\n## Benchmarks\n\nSpeed has never been a burning problem while eyeballing logs from applications, but any speed-up to the tools I use on a daily basis is always appreciated.\n\nTo benchmark `bunyan-rs` against the original NodeJS `bunyan` follow these steps:\n\n- Build `bunyan-rs` using the `release` profile:\n```bash\ncargo build --release\n```\n- Install `bunyan` via `npm`. You will need `npx` as well;\n- Benchmark!\n```bash\n# bunyan JS\ntime ./benchmark_js.sh benchmark_logs.txt\n# bunyan-rs\ntime ./benchmark_rs.sh benchmark_logs.txt\n```\n\nOn my system `bunyan-rs` is roughly 5x faster on this very non-scientific and highly inaccurate benchmark - your mileage may vary.  \nThe Rust code is highly non-optimised (we are allocating freely and wastefully!) - streamlining it could be a fun exercise.\n\n## License\n\nLicensed under either of Apache License, Version 2.0 or MIT license at your option.\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukemathwalker%2Fbunyan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukemathwalker%2Fbunyan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukemathwalker%2Fbunyan/lists"}