{"action":"created","comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/comments/46620177","id":46620177,"diff_hunk":"@@ -288,21 +288,28 @@ def filter(event)\n         end\n         #break if done\n       end # @patterns.each\n-  \n+\n       if matched\n         filter_matched(event)\n       else\n         # Tag this event if we can't parse it. We can use this later to\n         # reparse+reindex logs if we improve the patterns given.\n         @tag_on_failure.each do |tag|\n-          event[\"tags\"] ||= []\n-          event[\"tags\"] << tag unless event[\"tags\"].include?(tag)\n+          # do not replace the code below with:\n+          #   event[\"tags\"] ||= []\n+          #   event[\"tags\"] << tag unless event[\"tags\"].include?(tag)\n+          # this assumes implementation specific feature of returning a mutable object\n+          # from a field ref which should not be assumed and will change in the future.\n+\n+          tags = event[\"tags\"] || []","path":"lib/logstash/filters/grok.rb","position":187,"original_position":187,"commit_id":"40107a90ffb16afcceb6774a1a2313d7992937c7","original_commit_id":"40107a90ffb16afcceb6774a1a2313d7992937c7","user":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"body":"oh yes, good catch, I don't know why I did not correctly clean this. is can be replaced with a simple: \r\n```ruby\r\nevent.tag(tag)\r\n```","created_at":"2015-12-03T22:08:18Z","updated_at":"2015-12-03T22:08:18Z","html_url":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62#discussion_r46620177","pull_request_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/comments/46620177"},"html":{"href":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62#discussion_r46620177"},"pull_request":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62","id":51758161,"html_url":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62","diff_url":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62.diff","patch_url":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62.patch","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/62","number":62,"state":"open","locked":false,"title":"fix fieldref assignment to not assume mutable object\t","user":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"body":"this is related to problem described in elastic/logstash#4140 and also relates to elastic/logstash#4191\r\nwe cannot assume anymore that field reference getter returns a mutable object.\r\n\r\ntracked in elastic/logstash#4264\r\n\r\nsorry for the whitespaces diffs :(","created_at":"2015-11-25T06:47:55Z","updated_at":"2015-12-03T22:08:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"375d90be9cea63b8fb57978c78a256e419720f20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62/commits","review_comments_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62/comments","review_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/comments{/number}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/62/comments","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/statuses/40107a90ffb16afcceb6774a1a2313d7992937c7","head":{"label":"colinsurprenant:fix/fieldref","ref":"fix/fieldref","sha":"40107a90ffb16afcceb6774a1a2313d7992937c7","user":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"repo":{"id":46842689,"name":"logstash-filter-grok","full_name":"colinsurprenant/logstash-filter-grok","owner":{"login":"colinsurprenant","id":2010,"avatar_url":"https://avatars.githubusercontent.com/u/2010?v=3","gravatar_id":"","url":"https://api.github.com/users/colinsurprenant","html_url":"https://github.com/colinsurprenant","followers_url":"https://api.github.com/users/colinsurprenant/followers","following_url":"https://api.github.com/users/colinsurprenant/following{/other_user}","gists_url":"https://api.github.com/users/colinsurprenant/gists{/gist_id}","starred_url":"https://api.github.com/users/colinsurprenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinsurprenant/subscriptions","organizations_url":"https://api.github.com/users/colinsurprenant/orgs","repos_url":"https://api.github.com/users/colinsurprenant/repos","events_url":"https://api.github.com/users/colinsurprenant/events{/privacy}","received_events_url":"https://api.github.com/users/colinsurprenant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/colinsurprenant/logstash-filter-grok","description":"patterns_path","fork":true,"url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok","forks_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/forks","keys_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/keys{/key_id}","collaborators_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/teams","hooks_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/hooks","issue_events_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/issues/events{/number}","events_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/events","assignees_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/assignees{/user}","branches_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/branches{/branch}","tags_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/tags","blobs_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/git/refs{/sha}","trees_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/git/trees{/sha}","statuses_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/statuses/{sha}","languages_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/languages","stargazers_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/stargazers","contributors_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/contributors","subscribers_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/subscribers","subscription_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/subscription","commits_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/commits{/sha}","git_commits_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/git/commits{/sha}","comments_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/comments{/number}","issue_comment_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/issues/comments{/number}","contents_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/contents/{+path}","compare_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/compare/{base}...{head}","merges_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/merges","archive_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/downloads","issues_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/issues{/number}","pulls_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/pulls{/number}","milestones_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/milestones{/number}","notifications_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/labels{/name}","releases_url":"https://api.github.com/repos/colinsurprenant/logstash-filter-grok/releases{/id}","created_at":"2015-11-25T06:42:02Z","updated_at":"2015-11-25T06:42:02Z","pushed_at":"2015-11-25T06:42:12Z","git_url":"git://github.com/colinsurprenant/logstash-filter-grok.git","ssh_url":"git@github.com:colinsurprenant/logstash-filter-grok.git","clone_url":"https://github.com/colinsurprenant/logstash-filter-grok.git","svn_url":"https://github.com/colinsurprenant/logstash-filter-grok","homepage":"","size":59,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"logstash-plugins:master","ref":"master","sha":"934b13212085d9f99e1f3205a2b1a3cb7da669a1","user":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"repo":{"id":24894902,"name":"logstash-filter-grok","full_name":"logstash-plugins/logstash-filter-grok","owner":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/logstash-plugins/logstash-filter-grok","description":"patterns_path","fork":false,"url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok","forks_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/forks","keys_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/teams","hooks_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/hooks","issue_events_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/events{/number}","events_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/events","assignees_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/assignees{/user}","branches_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/branches{/branch}","tags_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/tags","blobs_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/git/refs{/sha}","trees_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/statuses/{sha}","languages_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/languages","stargazers_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/stargazers","contributors_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/contributors","subscribers_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/subscribers","subscription_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/subscription","commits_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/commits{/sha}","git_commits_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/git/commits{/sha}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/comments{/number}","issue_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/comments{/number}","contents_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/contents/{+path}","compare_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/merges","archive_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/downloads","issues_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues{/number}","pulls_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls{/number}","milestones_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/milestones{/number}","notifications_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/labels{/name}","releases_url":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/releases{/id}","created_at":"2014-10-07T14:46:44Z","updated_at":"2015-10-19T15:14:22Z","pushed_at":"2015-11-25T06:53:41Z","git_url":"git://github.com/logstash-plugins/logstash-filter-grok.git","ssh_url":"git@github.com:logstash-plugins/logstash-filter-grok.git","clone_url":"https://github.com/logstash-plugins/logstash-filter-grok.git","svn_url":"https://github.com/logstash-plugins/logstash-filter-grok","homepage":"","size":398,"stargazers_count":11,"watchers_count":11,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":21,"forks":24,"open_issues":21,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62"},"html":{"href":"https://github.com/logstash-plugins/logstash-filter-grok/pull/62"},"issue":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/62"},"comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/logstash-plugins/logstash-filter-grok/statuses/40107a90ffb16afcceb6774a1a2313d7992937c7"}}}}