{"id":26233964,"url":"https://github.com/teragrep/rsm_01","last_synced_at":"2026-04-09T10:40:27.336Z","repository":{"id":274491397,"uuid":"887177486","full_name":"teragrep/rsm_01","owner":"teragrep","description":"Teragrep record schema mapper library for Java ","archived":false,"fork":false,"pushed_at":"2025-04-08T07:58:25.000Z","size":46,"stargazers_count":0,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T08:45:38.654Z","etag":null,"topics":["data","data-mining","data-science","datascience","java-library","liblognorm","log-analysis","log-management","schema-mapper","structured-data","structured-logging","teragrep","unstructured-data"],"latest_commit_sha":null,"homepage":"https://teragrep.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teragrep.png","metadata":{"files":{"readme":"README.adoc","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-11-12T09:52:27.000Z","updated_at":"2025-04-08T07:58:29.000Z","dependencies_parsed_at":"2025-02-18T10:29:25.820Z","dependency_job_id":"398a4917-b2b0-4ba5-995b-524f4c100398","html_url":"https://github.com/teragrep/rsm_01","commit_stats":null,"previous_names":["teragrep/rsm_01"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frsm_01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frsm_01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frsm_01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frsm_01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/rsm_01/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237834,"owners_count":21397401,"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":["data","data-mining","data-science","datascience","java-library","liblognorm","log-analysis","log-management","schema-mapper","structured-data","structured-logging","teragrep","unstructured-data"],"created_at":"2025-03-13T01:18:18.068Z","updated_at":"2026-04-09T10:40:22.295Z","avatar_url":"https://github.com/teragrep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n= Teragrep Record Schema Mapper Library for Java\n\nRsm_01 is a library that provides record schema mapping (log normalization) functionality to Java using Liblognorm library that is written in C-code. All the functionalities of the Liblognorm library are provided to Java through the use of Java Native Access (JNA) library.\n\n== Features\n\n- Provides full access to log normalization functionalities of Liblognorm C-library in Java, which in short allows:\n. Matching a message line to a rule from provided rulebase configuration.\n. Picking out variable fields from the line according to the configuration.\n. Returning the picked variable fields as a JSON string object.\n- Capability to handle errors occurring in the C-library through Java exceptions.\n\n== How to compile\n\nhttps://maven.apache.org/install.html[Maven] and liblognorm-devel must be installed to build the project.\n\nProject building has been tested on Fedora 41.\n\n[,bash]\n----\ndnf install liblognorm-devel\n----\n\n[,bash]\n----\nmvn clean package\n----\n\n== How to use\n\n=== Configuration\n\nTo use rsm_01 for log normalization, two things are required:\n\n. Log messages\n. A rulebase, which configures how the messages are normalized by liblognorm\n\nThe rulebase consists of lines of text where each line reflects the structure of your log messages. Liblognorm will generate a parse-tree from the rulebase and then use it to parse the log messages during normalization. The provided rulebase must follow the version two configuration guidelines described in the https://www.liblognorm.com/files/manual/configuration.html[liblognorm documentations].\n\nA simple rulebase file with two different rules is structured as follows:\n[,txt]\n----\nversion=2\nrule=:%all:rest%\nrule=tag:Amount: %N:number%\n----\n\n=== Normalization\n\nNormalization is done by first initializing `LognormFactory` object with the rulebase given as an input argument for the constructor. The `lognorm()` method of the factory object is then used to provide a configured version of `JavaLognormImpl` object that is capable of normalizing messages through the `normalize()` method.\n\nThe rulebase can be provided to the `LognormFactory` constructor either as a `String` or as a `File` object. Rulebases in `String` format do not require the `version=2` indicator mentioned in liblognorm documentations.\n\nBecause of C memory management requirements, the `JavaLognormImpl` object must be closed when it is no longer needed. The typical use-case for normalization using try-with-resources is as follows:\n\n[,java]\n----\nLognormFactory lognormFactory = new LognormFactory(\"rule=:%all:rest%\");\ntry (JavaLognormImpl javaLognormImpl = lognormFactory.lognorm()) {\n    String normalizedMessage = javaLognormImpl.normalize(\"message to normalize\");\n}\n----\n\nIf normalization was a success, `normalizedMessage` will hold the normalization result in JSON string format.\n\n=== Additional configuration options\n\nLiblognorm API has additional configuration options available for normalization:\n\n. `LN_CTXOPT_ADD_ORIGINALMSG` — always adds original message to the normalization result.\n. `LN_CTXOPT_ADD_RULE` — adds mockup rule to the normalization result.\n. `LN_CTXOPT_ADD_RULE_LOCATION` — adds rule location (file, lineno) to the normalization result.\n\nThe configuration for the additional options is done by providing `OptionsStruct` object as an additional input argument for `LognormFactory` constructor.\n\n[,java]\n----\nLibJavaLognorm.OptionsStruct opts = new LibJavaLognorm.OptionsStruct();\nopts.CTXOPT_ADD_ORIGINALMSG = true;\nLognormFactory lognormFactory = new LognormFactory(opts, \"rule=:%all:rest%\");\ntry (JavaLognormImpl javaLognormImpl = lognormFactory.lognorm()) {\n    String normalizedMessage = javaLognormImpl.normalize(\"message to normalize\");\n}\n----\n\n== Contributing\n\nYou can involve yourself with our project by https://github.com/teragrep/rsm_01/issues/new/choose[opening an issue] or submitting a pull request.\n\nContribution requirements:\n\n. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.\n. Security checks must pass\n. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.\n. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).\n\nRead more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].\n\n=== Contributor License Agreement\n\nContributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.\n\nYou need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frsm_01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Frsm_01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frsm_01/lists"}