Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ansoni/fluent-plugin-json-schema-filter
Fluentd plugin to ensure that an inbound record validates to a well-defined schema
https://github.com/ansoni/fluent-plugin-json-schema-filter
Last synced: about 1 month ago
JSON representation
Fluentd plugin to ensure that an inbound record validates to a well-defined schema
- Host: GitHub
- URL: https://github.com/ansoni/fluent-plugin-json-schema-filter
- Owner: ansoni
- License: apache-2.0
- Created: 2016-05-12T04:30:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-05T06:00:13.000Z (over 7 years ago)
- Last Synced: 2024-07-26T22:58:57.932Z (5 months ago)
- Language: Ruby
- Size: 11.7 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - ansoni/fluent-plugin-json-schema-filter - Fluentd plugin to ensure that an inbound record validates to a well-defined schema (Ruby)
README
# fluent-plugin-json-schema-filter
[![Build Status](https://travis-ci.org/ansoni/fluent-plugin-json-schema-filter.svg?branch=master)](https://travis-ci.org/ansoni/fluent-plugin-json-schema-filter)
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-json-schema-filter.svg)](https://badge.fury.io/rb/fluent-plugin-json-schema-filter)[Fluentd](http://fluentd.org) filter plugin to validate records against a [json-schema](http://json-schema.org)
## Installation
Use RubyGems:gem install fluent-plugin-json-schema-filter
## Configuration
*Discard Example*:
@type json_schema
mode discard
schema_file /some/path.json #defaults to /etc/td-agent/schema.json
will result in records that do not validate being completely discarded.
*Isolate Example*:
@type json_schema
mode isolate
schema_file ...
isolate_tag_prefix invalid
add_validation_error true # results in a validation-error key being added to the record
will result in invalid records being tagged as "invalid.". In the example above, invalid records would be invalid.foo.\*\*
*Enrich Example*
@type json_schema
mode enrich
schema_file ...
enrich_valid {
'valid': 'This is a great document'
} # default valid: true
enrich_invalid {
'invalid': 'You suck at the JSON'
} # default valid: false
add_validation_error true # results in a validation-error key being added to the record
will result in messages gaining either the enrich_valid or enrich_invalid depending on how the record validates.
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request