{"action":"created","issue":{"url":"https://api.github.com/repos/fluent/fluentd/issues/685","labels_url":"https://api.github.com/repos/fluent/fluentd/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/fluent/fluentd/issues/685/comments","events_url":"https://api.github.com/repos/fluent/fluentd/issues/685/events","html_url":"https://github.com/fluent/fluentd/issues/685","id":112621721,"number":685,"title":"in_tail plugin; multiline mode; chomp","user":{"login":"reinerRubin","id":7375979,"avatar_url":"https://avatars.githubusercontent.com/u/7375979?v=3","gravatar_id":"","url":"https://api.github.com/users/reinerRubin","html_url":"https://github.com/reinerRubin","followers_url":"https://api.github.com/users/reinerRubin/followers","following_url":"https://api.github.com/users/reinerRubin/following{/other_user}","gists_url":"https://api.github.com/users/reinerRubin/gists{/gist_id}","starred_url":"https://api.github.com/users/reinerRubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinerRubin/subscriptions","organizations_url":"https://api.github.com/users/reinerRubin/orgs","repos_url":"https://api.github.com/users/reinerRubin/repos","events_url":"https://api.github.com/users/reinerRubin/events{/privacy}","received_events_url":"https://api.github.com/users/reinerRubin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T15:57:22Z","updated_at":"2015-10-27T10:40:11Z","closed_at":"2015-10-27T10:40:11Z","body":"There is [chomp](https://github.com/fluent/fluentd/blob/5d9eb04a8523ff3ada332e4199aeace1fb7002d6/lib/fluent/plugin/in_tail.rb#L245) in def convert_line_to_event (tail plugin). If we jump from [multiline mode](https://github.com/fluent/fluentd/blob/5d9eb04a8523ff3ada332e4199aeace1fb7002d6/lib/fluent/plugin/in_tail.rb#L245), it can be very confusing get \"pattern not match\" after first successful match.\r\n\r\nMaybe chomp in multiline mode is wrong behaviour?\r\n\r\nSorry for my poor English. "},"comment":{"url":"https://api.github.com/repos/fluent/fluentd/issues/comments/151451860","html_url":"https://github.com/fluent/fluentd/issues/685#issuecomment-151451860","issue_url":"https://api.github.com/repos/fluent/fluentd/issues/685","id":151451860,"user":{"login":"reinerRubin","id":7375979,"avatar_url":"https://avatars.githubusercontent.com/u/7375979?v=3","gravatar_id":"","url":"https://api.github.com/users/reinerRubin","html_url":"https://github.com/reinerRubin","followers_url":"https://api.github.com/users/reinerRubin/followers","following_url":"https://api.github.com/users/reinerRubin/following{/other_user}","gists_url":"https://api.github.com/users/reinerRubin/gists{/gist_id}","starred_url":"https://api.github.com/users/reinerRubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinerRubin/subscriptions","organizations_url":"https://api.github.com/users/reinerRubin/orgs","repos_url":"https://api.github.com/users/reinerRubin/repos","events_url":"https://api.github.com/users/reinerRubin/events{/privacy}","received_events_url":"https://api.github.com/users/reinerRubin/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T10:40:11Z","updated_at":"2015-10-27T10:40:11Z","body":"Sorry for my late reply.\r\n\r\nNow we are not using multiline mode and I don't have good examples.\r\n\r\nI played around recursive regexp: // I know it's wrong and terrible approach but speech is about validation consistency.\r\n```ruby\r\n(?<msg>panic:.+?)$.*?goroutine.+?$\\n(?<body>((?<line>^(?!panic:).*?$\\n)\\g<line>{,3}))\r\n``` \r\nIn first parse statement regexp matches string with \\n at the end, but after chomp! regexp does not match. But buffer will be [flush](https://github.com/fluent/fluentd/blob/5d9eb04a8523ff3ada332e4199aeace1fb7002d6/lib/fluent/plugin/in_tail.rb#L291).\r\n\r\nAlso sorry second link in op must be https://github.com/fluent/fluentd/blob/5d9eb04a8523ff3ada332e4199aeace1fb7002d6/lib/fluent/plugin/in_tail.rb#L291"}}