{"action":"created","comment":{"url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/comments/30944929","id":30944929,"diff_hunk":"@@ -84,6 +87,14 @@ public static StructuredSyslogMessage fromString(\n \r\n     private void  deserialize(final String stringMessage) {\r\n \r\n+        // Check if the RFC5424 MSGID and STRUCTURED-DATA fields are empty.\r\n+        // This avoids throwing an exception and also strips the \"- - \" from the message.\r\n+        // See: https://github.com/Graylog2/graylog2-server/issues/1161\r\n+        if (stringMessage.startsWith(EMPTY_STRUCTURED_DATA_PREFIX)) {\r","path":"src/main/java/org/graylog2/syslog4j/impl/message/structured/StructuredSyslogMessage.java","position":17,"original_position":17,"commit_id":"91557d687fa89f9cfcc1d38a0a38a3bd84625b5d","original_commit_id":"91557d687fa89f9cfcc1d38a0a38a3bd84625b5d","user":{"login":"joschi","id":43951,"avatar_url":"https://avatars.githubusercontent.com/u/43951?v=3","gravatar_id":"","url":"https://api.github.com/users/joschi","html_url":"https://github.com/joschi","followers_url":"https://api.github.com/users/joschi/followers","following_url":"https://api.github.com/users/joschi/following{/other_user}","gists_url":"https://api.github.com/users/joschi/gists{/gist_id}","starred_url":"https://api.github.com/users/joschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joschi/subscriptions","organizations_url":"https://api.github.com/users/joschi/orgs","repos_url":"https://api.github.com/users/joschi/repos","events_url":"https://api.github.com/users/joschi/events{/privacy}","received_events_url":"https://api.github.com/users/joschi/received_events","type":"User","site_admin":false},"body":"A little late to the party, sorry.\r\n\r\nShouldn't we check if `message` is null or empty and that `structuredData` is an empty collection? Otherwise messages which start with \"- - \" intentionally will incorrectly get truncated.","created_at":"2015-05-23T13:26:44Z","updated_at":"2015-05-23T13:26:44Z","html_url":"https://github.com/Graylog2/syslog4j-graylog2/pull/4#discussion_r30944929","pull_request_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/comments/30944929"},"html":{"href":"https://github.com/Graylog2/syslog4j-graylog2/pull/4#discussion_r30944929"},"pull_request":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4","id":36046965,"html_url":"https://github.com/Graylog2/syslog4j-graylog2/pull/4","diff_url":"https://github.com/Graylog2/syslog4j-graylog2/pull/4.diff","patch_url":"https://github.com/Graylog2/syslog4j-graylog2/pull/4.patch","issue_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/4","number":4,"state":"closed","locked":false,"title":"Fix parsing of empty RFC5424 structured data in a message.","user":{"login":"bernd","id":461,"avatar_url":"https://avatars.githubusercontent.com/u/461?v=3","gravatar_id":"","url":"https://api.github.com/users/bernd","html_url":"https://github.com/bernd","followers_url":"https://api.github.com/users/bernd/followers","following_url":"https://api.github.com/users/bernd/following{/other_user}","gists_url":"https://api.github.com/users/bernd/gists{/gist_id}","starred_url":"https://api.github.com/users/bernd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bernd/subscriptions","organizations_url":"https://api.github.com/users/bernd/orgs","repos_url":"https://api.github.com/users/bernd/repos","events_url":"https://api.github.com/users/bernd/events{/privacy}","received_events_url":"https://api.github.com/users/bernd/received_events","type":"User","site_admin":false},"body":"This avoids throwing an exception and also strips the `- - ` from the resulting message.\r\n\r\nRefs Graylog2/graylog2-server#1161","created_at":"2015-05-22T16:24:50Z","updated_at":"2015-05-23T13:26:44Z","closed_at":"2015-05-22T16:30:44Z","merged_at":"2015-05-22T16:30:44Z","merge_commit_sha":"8a819631eb755f548a4123f8ace8052a52325dcc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/4/comments","statuses_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/statuses/91557d687fa89f9cfcc1d38a0a38a3bd84625b5d","head":{"label":"Graylog2:fix-empty-structured-data-parsing","ref":"fix-empty-structured-data-parsing","sha":"91557d687fa89f9cfcc1d38a0a38a3bd84625b5d","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":8785430,"name":"syslog4j-graylog2","full_name":"Graylog2/syslog4j-graylog2","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/syslog4j-graylog2","description":"The syslog4j fork from Graylog2. This is used since 0.10.0. The original code was very \"special\" and no actions were taken to improve it. This is planned to be replaced completely in future versions.","fork":false,"url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2","forks_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/forks","keys_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/teams","hooks_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/events","assignees_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/tags","blobs_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/languages","stargazers_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/subscription","commits_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/merges","archive_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/downloads","issues_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/releases{/id}","created_at":"2013-03-14T21:07:00Z","updated_at":"2015-03-31T16:15:56Z","pushed_at":"2015-05-22T18:47:05Z","git_url":"git://github.com/Graylog2/syslog4j-graylog2.git","ssh_url":"git@github.com:Graylog2/syslog4j-graylog2.git","clone_url":"https://github.com/Graylog2/syslog4j-graylog2.git","svn_url":"https://github.com/Graylog2/syslog4j-graylog2","homepage":null,"size":801,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"Graylog2:master","ref":"master","sha":"3a4555e1ca73f8ed298ec1be7a5b1fe0de4c31f4","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":8785430,"name":"syslog4j-graylog2","full_name":"Graylog2/syslog4j-graylog2","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/syslog4j-graylog2","description":"The syslog4j fork from Graylog2. This is used since 0.10.0. The original code was very \"special\" and no actions were taken to improve it. This is planned to be replaced completely in future versions.","fork":false,"url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2","forks_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/forks","keys_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/teams","hooks_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/events","assignees_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/tags","blobs_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/languages","stargazers_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/subscription","commits_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/merges","archive_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/downloads","issues_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/releases{/id}","created_at":"2013-03-14T21:07:00Z","updated_at":"2015-03-31T16:15:56Z","pushed_at":"2015-05-22T18:47:05Z","git_url":"git://github.com/Graylog2/syslog4j-graylog2.git","ssh_url":"git@github.com:Graylog2/syslog4j-graylog2.git","clone_url":"https://github.com/Graylog2/syslog4j-graylog2.git","svn_url":"https://github.com/Graylog2/syslog4j-graylog2","homepage":null,"size":801,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4"},"html":{"href":"https://github.com/Graylog2/syslog4j-graylog2/pull/4"},"issue":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/4"},"comments":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Graylog2/syslog4j-graylog2/statuses/91557d687fa89f9cfcc1d38a0a38a3bd84625b5d"}}}}