{"id":26582936,"url":"https://github.com/medunes/stashlog","last_synced_at":"2026-05-18T02:31:28.365Z","repository":{"id":283875233,"uuid":"867866076","full_name":"MedUnes/stashlog","owner":"MedUnes","description":"A Rust Library for Logstash format logging.","archived":false,"fork":false,"pushed_at":"2024-10-05T20:01:40.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T10:34:36.686Z","etag":null,"topics":["crate","elasticsearch","elk","elk-stack","filebeat","kibana","libraries","library","logger","logging","logs","logstash","monolog","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/MedUnes.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":"2024-10-04T22:10:33.000Z","updated_at":"2024-10-05T20:01:28.000Z","dependencies_parsed_at":"2025-03-22T19:01:57.809Z","dependency_job_id":"08453c43-3b43-4e63-a293-90dda46785be","html_url":"https://github.com/MedUnes/stashlog","commit_stats":null,"previous_names":["medunes/stashlog"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/MedUnes/stashlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MedUnes%2Fstashlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MedUnes%2Fstashlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MedUnes%2Fstashlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MedUnes%2Fstashlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MedUnes","download_url":"https://codeload.github.com/MedUnes/stashlog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MedUnes%2Fstashlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["crate","elasticsearch","elk","elk-stack","filebeat","kibana","libraries","library","logger","logging","logs","logstash","monolog","rust","rust-lang"],"created_at":"2025-03-23T08:19:01.192Z","updated_at":"2026-05-18T02:31:28.349Z","avatar_url":"https://github.com/MedUnes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust StashLog\n\nA minimalistic Rust library for [Logstash Event](https://github.com/elastic/logstash/blob/main/logstash-core/src/main/java/org/logstash/Event.java) format logging.\n\n\n[![Release](https://github.com/MedUnes/stashlog/actions/workflows/publish.yml/badge.svg)](https://github.com/MedUnes/stashlog/actions/workflows/publish.yml) [![Build](https://github.com/MedUnes/stashlog/actions/workflows/test.yml/badge.svg)](https://github.com/MedUnes/stashlog/actions/workflows/test.yml)\n\n### Usage\n\n```rust\nuse medunes::stashlog;\nfn main() {\n        let logger = stashlog::Logger {\n            config: Config {\n                version: 1,\n                app_name: \"my-app\".to_string(),\n                file_path: \"/home/my-app/logs/logstash.log\".to_string(),\n            },\n        };\n        logger.info(\"User Logged in\");\n        logger.info_extra(\"User Logged in\", \u0026json!({\"user_id\": user_id}).to_string());\n        logger.error_extra(\"Maximum login attemps reached\", \u0026json!({\"user_id\": user_id}).to_string());\n```\n\n### An example of production case scenario\n\n#### 1- Generate with `StashLog`\n\nYour rust application uses the `stashlog` package to output logs to a preconfigured file path: for example here ```/opt/example-app/log-path/logstash.log```\n\n#### 2- Push with ```Filebeat```\n\n* We suppose the app on the server writes logs to ```/opt/example-app/log-path/logstash.log```\n* Here is an example [filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-overview.html) configuration which keeps pusing the log changes to a [Logstash](https://www.elastic.co/logstash) server supposedly at ```some-server.logstash.com:5044```\n\n```yaml\n#/etc/filebeat/filebeat.yml\nfilebeat.inputs:\n- type: log\n  enabled: true\n  paths:\n    - /opt/example-app/log-path/logstash.log\n  fields:\n    log_type: logstash\n\noutput.logstash:\n  hosts: [\"some-server.logstash.com:5044\"]\n  transport: udp\n```\n\n#### 3- Collect \u0026 View with ```ELK```\n\n* [Logstash](https://www.elastic.co/logstash), if correctly configured, will index the incoming traffic to  [Elasticsearch](https://www.elastic.co/elasticsearch)\n* You can then use [Kibana](https://www.elastic.co/kibana) to search, filter and visualize your application's logs.\n\n![ELK Logging Stack](elk.webp)\n\n### Credits\n\n* Inspired from [Monolog](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Formatter/LogstashFormatter.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedunes%2Fstashlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmedunes%2Fstashlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmedunes%2Fstashlog/lists"}