{"id":28392166,"url":"https://github.com/febit/febit-rectify","last_synced_at":"2025-06-26T01:31:42.962Z","repository":{"id":75159567,"uuid":"151511698","full_name":"febit/febit-rectify","owner":"febit","description":"Transform raw data (json, access log, csv, custom structured log, etc.) to structured record, with schema.","archived":false,"fork":false,"pushed_at":"2023-10-12T15:59:43.000Z","size":511,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T22:44:24.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/febit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-10-04T03:04:53.000Z","updated_at":"2023-08-30T07:41:42.000Z","dependencies_parsed_at":"2023-03-11T18:30:12.586Z","dependency_job_id":"e24f5751-f7a8-44e3-9031-60a6c7a03e35","html_url":"https://github.com/febit/febit-rectify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/febit/febit-rectify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febit%2Ffebit-rectify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febit%2Ffebit-rectify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febit%2Ffebit-rectify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febit%2Ffebit-rectify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/febit","download_url":"https://codeload.github.com/febit/febit-rectify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/febit%2Ffebit-rectify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261982525,"owners_count":23240080,"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":"2025-05-31T11:43:14.187Z","updated_at":"2025-06-26T01:31:42.950Z","avatar_url":"https://github.com/febit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# febit-rectify\n\nTransform raw data (json, access log, csv, custom structured log, etc.) to structured record, with schema.\n\n## Features\n\n+ JS Style \u0026 Java Friendly expression, using [febit-wit](https://github.com/febit/wit) as script engine\n+ Free input, by defining your own `SourceFormat`\n+ Free output, by defining your own `StructSpec`\n+ Clean and free runtime environment, all internal methods prefixed by `$$_`, you can register your own methods\n  by `EnginePlugin` (SPI)\n\n## Usage\n\n```java\n// `$` is input, can be used in global-filter, global-code (except const statement), column expressions\n// `$$` is current column value, can be used in column check expression\nvar conf = RectifierConf.conf()\n    // Named your schema\n    .name(\"Demo\")\n    // Global code\n    .globalCode(\"\"\n            + \"var isTruly = obj -\u003e {\\n\"\n            + \"   return obj == true \\n\"\n            + \"              || obj == \\\"on\\\" || obj == \\\"true\\\"\\n\"\n            + \"              || obj == 1;\\n\"\n            + \"};\")\n    // Global filters:\n    //    Notice: only a Boolean.FALSE or a non-null String (reason) can ban current row, others pass.\n    .globalFilter(\"$.status \u003e 0\")\n    //    Recommend: give a reason if falsely, `||` is logic OR (just what it means to in JS, feel free!).\n    .globalFilter(\"$.status \u003c 100 || \\\"status should \u003c100\\\"\")\n    // Global code and filters, Will be executed in defined order.\n    .globalCode(\"var isEven = $.status % 2 == 0 \")\n    .globalCode(\"var statusCopy = $.status\")\n    .globalFilter(\"isEven || \\\"status is not even\\\"\")\n    // Columns\n    .column(\"long\", \"id\", \"$.id\")\n    // column with check expression\n    .column(\"boolean\", \"enable\", \"\", \"$$ || \\\"enable is falsely\\\"\")\n    .column(\"int\", \"status\", \"$.status\")\n    .column(\"boolean\", \"isEven\", \"isEven\")\n    .column(\"boolean\", \"call_isTruly\", \"isTruly($.isTrulyArg)\")\n    .column(\"string\", \"content\", \"\\\"prefix:\\\"+$.content\");\n\nRectifier\u003cString, Map\u003cString, Object\u003e\u003e rectifier = conf.build(new JsonSourceFormat());\n\nrectifier.process(json, consumer);\n```\n\n## License\n\nfebit-rectify is distributed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffebit%2Ffebit-rectify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffebit%2Ffebit-rectify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffebit%2Ffebit-rectify/lists"}