{"id":23074489,"url":"https://github.com/iamazeem/fluent-plugin-json","last_synced_at":"2025-07-27T00:33:25.240Z","repository":{"id":45092318,"uuid":"281837914","full_name":"iamazeem/fluent-plugin-json","owner":"iamazeem","description":"Fluentd filter plugin for JSON events with JSON Pointer Support (RFC-6901)","archived":false,"fork":false,"pushed_at":"2024-09-19T09:23:30.000Z","size":39,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T18:05:28.269Z","etag":null,"topics":["fluentd","fluentd-filter-plugin","fluentd-plugin","hacktoberfest","json","json-pointer"],"latest_commit_sha":null,"homepage":"https://github.com/iamAzeem/fluent-plugin-json","language":"Ruby","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/iamazeem.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":"2020-07-23T03:11:48.000Z","updated_at":"2024-10-01T23:38:18.000Z","dependencies_parsed_at":"2024-12-16T08:29:50.193Z","dependency_job_id":"54c633f0-0bb0-4c72-85bf-a45d5264d959","html_url":"https://github.com/iamazeem/fluent-plugin-json","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"25575768642416a257239bc7a40252112589381c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/iamazeem/fluent-plugin-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Ffluent-plugin-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Ffluent-plugin-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Ffluent-plugin-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Ffluent-plugin-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamazeem","download_url":"https://codeload.github.com/iamazeem/fluent-plugin-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamazeem%2Ffluent-plugin-json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262068115,"owners_count":23253735,"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":["fluentd","fluentd-filter-plugin","fluentd-plugin","hacktoberfest","json","json-pointer"],"created_at":"2024-12-16T08:28:38.940Z","updated_at":"2025-06-26T12:32:04.031Z","avatar_url":"https://github.com/iamazeem.png","language":"Ruby","readme":"# fluent-plugin-json\n\n[![ci](https://github.com/iamazeem/fluent-plugin-json/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iamazeem/fluent-plugin-json/actions/workflows/ci.yml)\n[![License: Apache](https://img.shields.io/badge/license-Apache-darkgreen.svg?style=flat-square)](https://github.com/iamAzeem/fluent-plugin-json/blob/master/LICENSE)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/iamAzeem/fluent-plugin-json?style=flat-square)\n[![RubyGems Downloads](https://img.shields.io/gem/dt/fluent-plugin-json?style=flat-square)](https://rubygems.org/gems/fluent-plugin-json)\n\n## Overview\n\n[Fluentd](https://fluentd.org/) filter plugin for JSON with JSON pointer support\n([RFC-6901](https://tools.ietf.org/html/rfc6901)).\n\n## Installation\n\n### RubyGems\n\n```shell\ngem install fluent-plugin-json\n```\n\n### Bundler\n\nAdd the following line to your Gemfile:\n\n```ruby\ngem 'fluent-plugin-json'\n```\n\nAnd then execute:\n\n```shell\nbundle\n```\n\n## Configuration\n\n### `\u003ccheck\u003e` section (required) (multiple)\n\n* `pointer` (string) (required): The JSON pointer to an element.\n* `pattern` (regexp) (required): The regular expression to match the element.\n\nThe configuration may consist of one or more checks. Each check contains a\n`pointer` to a JSON element and its corresponding `pattern` (regex) to test it.\n\nThe checks are evaluated sequentially. The failure of a single check results in\nthe rejection of the event. A rejected event is not routed for further\nprocessing.\n\n**NOTE**: The JSON element pointed to by the `pointer` is always converted to a\nstring for testing with the `pattern` (regex).\n\nFor the detailed syntax of:\n\n- JSON Pointer, see [RFC-6901](https://tools.ietf.org/html/rfc6901#section-5); and,\n- Ruby's Regular Expression, see [Regexp](https://ruby-doc.org/core-2.4.1/Regexp.html).\n\n### Example\n\nHere is a sample configuration with\n[`forward`](https://docs.fluentd.org/v/1.0/input/forward) input plugin, `json`\nfilter plugin with multiple checks and the routing to\n[`stdout`](https://docs.fluentd.org/v/1.0/output/stdout) output plugin:\n\n```text\n\u003csource\u003e\n  @type       forward\n  @id         forward_input\n\u003c/source\u003e\n\n\u003cfilter debug.test\u003e\n  @type       json\n  @id         json_filter\n\n  \u003ccheck\u003e\n    pointer   /log/user     # point to { \"log\": { \"user\": \"test\", ... } }\n    pattern   /test/i       # check it against the value of username `test` (ignore case)\n  \u003c/check\u003e\n\n  \u003ccheck\u003e\n    pointer   /log/codes/0  # point to { \"log\": { \"codes\": [123, ...] } }\n    pattern   /123/         # check it against the value at 0th index of the codes array i.e. `123`\n  \u003c/check\u003e\n\n  \u003ccheck\u003e\n    pointer   /log/level    # point to { \"log\": { \"level\": \"info\", ... } }\n    pattern   /.*/          # check it against all the log levels\n  \u003c/check\u003e\n\u003c/filter\u003e\n\n\u003cmatch debug.test\u003e\n  @type       stdout\n\u003c/match\u003e\n```\n\nFor a JSON message:\n\n```json\n{ \"log\": {\"user\": \"test\", \"codes\": [123, 456], \"level\": \"info\"} }\n```\n\nSent using `fluent-cat` with tag `debug.test`:\n\n```bash\necho '{ \"log\": {\"user\": \"test\", \"codes\": [123, 456], \"level\": \"info\"} }' | fluent-cat \"debug.test\"\n```\n\nAfter passing all the checks, the routed event to `stdout` would be:\n\n```bash\n2020-07-23 22:36:06.093187459 +0500 debug.test: {\"log\":{\"user\":\"test\",\"codes\":[123,456],\"level\":\"info\"}}\n```\n\nBy default, the checks are logged in `debug` mode only:\n\n```text\n2020-07-23 22:47:33 +0500 [debug]: #0 [json_filter] check: pass [/log/user -\u003e 'test'] (/test/)\n2020-07-23 22:47:33 +0500 [debug]: #0 [json_filter] check: pass [/log/codes/0 -\u003e '123'] (/123/)\n2020-07-23 22:47:33 +0500 [debug]: #0 [json_filter] check: pass [/log/level -\u003e 'info'] (/.*/)\n2020-07-23 22:47:33.577900915 +0500 debug.test: {\"log\":{\"user\":\"test\",\"codes\":[123,456],\"level\":\"info\"}}\n```\n\n## Contribute\n\n- Fork the project.\n- Check out the latest `main` branch.\n- Create a feature or bugfix branch from `main`.\n- Commit and push your changes.\n- Make sure to add and run tests locally: `bundle exec rake test`.\n- Run `rubocop` locally and fix all the lint warnings.\n- Submit the PR.\n\n## License\n\n[Apache 2.0](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamazeem%2Ffluent-plugin-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamazeem%2Ffluent-plugin-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamazeem%2Ffluent-plugin-json/lists"}