{"id":26234005,"url":"https://github.com/teragrep/rlo_06","last_synced_at":"2025-10-24T20:46:47.949Z","repository":{"id":58201525,"uuid":"460436992","full_name":"teragrep/rlo_06","owner":"teragrep","description":"Teragrep syslog (RFC 5424) library for Java","archived":false,"fork":false,"pushed_at":"2025-04-07T13:11:42.000Z","size":179,"stargazers_count":1,"open_issues_count":19,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T13:23:52.590Z","etag":null,"topics":["java","parser","rfc-5424","rfc5424","rfc5424-parser","syslog","syslog-parser","syslog-server","teragrep"],"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":"2022-02-17T13:00:04.000Z","updated_at":"2025-04-07T13:11:46.000Z","dependencies_parsed_at":"2024-08-28T10:45:53.635Z","dependency_job_id":"7be78a2a-5b13-49a2-b356-b5586ac0e0f5","html_url":"https://github.com/teragrep/rlo_06","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlo_06","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlo_06/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlo_06/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlo_06/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/rlo_06/tar.gz/refs/heads/master","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":["java","parser","rfc-5424","rfc5424","rfc5424-parser","syslog","syslog-parser","syslog-server","teragrep"],"created_at":"2025-03-13T01:18:28.860Z","updated_at":"2025-10-24T20:46:42.905Z","avatar_url":"https://github.com/teragrep.png","language":"Java","readme":"= teragrep RFC5424 parser\n\nFeatures\n\n* Fast\n\nNon-features\n\n* Excellent strictness\n\n\n== License\nAGPLv3 with link:https://github.com/teragrep/rlo_06/blob/master/LICENSE#L665-L670[additional permissions] granted in the license.\n\n\n== Usage\n\nCAUTION: Please note that `next()` mutates the contents of the Fragments (`rfc5424Frame.priority`, `rfc5424Frame.version` etc) and it is not advised to have references to these between the calls.\n\nSimply create a `new RFC5424Frame`, give it an inputstream with `load(inputStream)` and read data with `next()`. It will return true or false depending on whether there were data to read. Note that `toString()` needs to be used when printing. You can optionally pass `true` to in the constructor for enabling newline feed termination, defaults to `false`.\n\n[source,java]\n----\nboolean linefeedTermination = false;\nRFC5424Frame rfc5424Frame = new RFC5424Frame(linefeedTermination);\nrfc5424Frame.load(inputStream);\nif(rfc5424Frame.next()) {\n    System.out.println(\"Priority: \" + rfc5424Frame.priority.toString());\n    System.out.println(\"Version: \" + rfc5424Frame.version.toString());\n    System.out.println(\"Timestamp: \" + rfc5424Frame.timestamp.toString());\n    System.out.println(\"Hostname: \" + rfc5424Frame.hostname.toString());\n    System.out.println(\"Appname: \" + rfc5424Frame.appName.toString());\n    System.out.println(\"ProcID: \" + rfc5424Frame.procId.toString());\n    System.out.println(\"MsgID: \" + rfc5424Frame.msgId.toString());\n    System.out.println(\"Message: \" + rfc5424Frame.msg.toString());\n}\nelse {\n    System.out.printn(\"No data left\");\n}\n----\n\nFor structured data property extraction, create a `new SDVector(\"key@48577\", \"value\");` and pass it to `rfc5424Frame.structuredData.getValue(sdVector)`:\n\n[source,java]\n----\nSDVector sdVector = new SDVector(\"ID_ELEMENT_NAME@48577\", \"ELEMENT_KEY\");\n// \"\u003c14\u003e1 2014-06-20T09:14:07.123456+00:00 hostname appname - - [ID_ELEMENT_NAME@48577 ELEMENT_KEY=\\\"MyValue\\\"] message\";\n//                                                               ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^\n\nSystem.out.println(rfc5424Frame.structuredData.getValue(sdVector).toString()); // Returns \"MyValue\"\n----\n\nYou can also access structured data directly as a list:\n\n[source,java]\n----\nfor (SDElement sdElement : rfc5424Frame.structuredData.sdElements) {\n    System.out.println(\"SDElement \" + sdElement.sdElementId + \" has: \");\n    for (SDParam sdParam : sdElement.sdParams) {\n        System.out.println(\"\\tKey: '\" + sdParam.sdParamKey + \"' Value: '\"+ sdParam.sdParamValue + \"'\");\n    }\n}\n----\n\nYou can get Severity and Facility values using `RFC5424Severity` and `RFC5424Facility` classes:\n\n[source,java]\n----\n// \"\u003c134\u003e1 2018-01-01T10:12:00+01:00 hostname appname - - - Message\";\n// 16*8 + 6 = 134\nRFC5424Facility facility = new RFC5424Facility(rfc5424Frame.priority);\nRFC5424Severity severity = new RFC5424Severity(rfc5424Frame.priority);\n\nSystem.out.println(\"Facility is \" + facility.asInt()); // 16\nSystem.out.println(\"Severity is \" + severity.asInt()); // 6\n----\n\nYou can get `ZonedDateTime` using `RFC5424Timestamp` class:\n\n[source,java]\n----\nRFC5424Timestamp timestamp = new RFC5424Timestamp(rfc5424Frame.timestamp);\nSystem.out.println(\"Current timestamp in ZonedDateTime: \" + timestamp.toZonedDateTime());\n----\n\n## Contributing\n\n// Change the repository name in the issues link to match with your project's name\n\nYou can involve yourself with our project by https://github.com/teragrep/rlo_06/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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlo_06","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Frlo_06","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlo_06/lists"}