https://github.com/bubustack/json-filter-engram
JSON filter Engram for bobrapet โ filters and transforms JSON payloads with JSONPath selection.
https://github.com/bubustack/json-filter-engram
batch bubustack engram filter go json jsonpath kubernetes
Last synced: about 1 month ago
JSON representation
JSON filter Engram for bobrapet โ filters and transforms JSON payloads with JSONPath selection.
- Host: GitHub
- URL: https://github.com/bubustack/json-filter-engram
- Owner: bubustack
- License: apache-2.0
- Created: 2026-02-02T14:42:40.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-05-02T07:11:03.000Z (about 1 month ago)
- Last Synced: 2026-05-02T09:18:36.153Z (about 1 month ago)
- Topics: batch, bubustack, engram, filter, go, json, jsonpath, kubernetes
- Language: Go
- Homepage: https://bubustack.io/
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
Awesome Lists containing this project
README
# ๐งฎ JSON Filter Engram
Selects structured data from JSON payloads (inline or $bubuStorageRef-offloaded)
and returns a compact result object configurable by selectors.
## ๐ Highlights
- Works with inline or offloaded JSON using the same schema.
- Supports `matchField`, `valuePath`, `outputKey`, and conditional inclusion.
- Returns deterministic inline metadata that downstream steps consume directly.
## ๐ Quick Start
```bash
go test ./...
```
Apply `Engram.yaml`, then reference the template in your Story step and supply
the selector inputs shown below.
## โ๏ธ Configuration (`Engram.spec.with`)
This engram currently exposes no component-level `Engram.spec.with` options.
Its `configSchema` is empty, so behavior is controlled entirely by per-execution
inputs.
## ๐ฅ Inputs
- `input`: JSON data (inline or storage ref).
- `select.itemsPath`: JSONPath to the array of items.
- `select.matchField`: field within each item to compare.
- `select.matchValue`: value that must match for inclusion.
- `select.valuePath`: subfield whose value is captured.
- `select.outputKey`: key name for the extracted result.
- `select.includeItem`: includes the matched item when `true`.
- `select.requireMatch`: fails the step when `true` and no match is found.
- `parseJSONText`: parses stringified JSON payloads when `true`.
Example:
```yaml
select:
itemsPath: channels
matchField: name
matchValue: daily-digest
outputKey: channelId
```
## ๐ค Outputs
Returns an object under `resultSelected` with the configured `outputKey` and,
when `includeItem` is `true`, the matching item under `item`.
## ๐งช Local Development
- `go test ./...` โ Run unit tests covering inline/offload flows.
- `go vet ./...` โ Ensure schema compliance before publishing.
## ๐ค Community & Support
- [Contributing](./CONTRIBUTING.md)
- [Support](./SUPPORT.md)
- [Security Policy](./SECURITY.md)
- [Code of Conduct](./CODE_OF_CONDUCT.md)
- [Discord](https://discord.gg/dysrB7D8H6)
## ๐ License
Copyright 2025 BubuStack.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.