{"action":"created","comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/comments/44698415","id":44698415,"diff_hunk":"@@ -138,11 +138,18 @@ def self.hosts(options)\n             result.flatten.join(\",\")\n           end\n \n+          # Normalizes the Java response to a reasonable approximation of the HTTP datastructure for interop\n+          # with the HTTP code\n           def self.normalize_bulk_response(bulk_response)\n-            # TODO(talevy): parse item response objects to retrieve correct 200 (OK) or 201(created) status codes\n+            items = bulk_response.map {|i|\n+              if i.is_failed\n+                [[i.get_op_type,  {\"status\" => i.get_failure.get_status.get_status, \"message\" => i.failureMessage}]]\n+              else\n+                [[i.get_op_type, {\"status\" => 200, \"message\" => \"OK\"}]]","path":"lib/logstash/outputs/elasticsearch_java/protocol.rb","position":12,"original_position":12,"commit_id":"533896f98cfa36fd45b6cc5dfb38ee2218579cc2","original_commit_id":"533896f98cfa36fd45b6cc5dfb38ee2218579cc2","user":{"login":"andrewvc","id":131427,"avatar_url":"https://avatars.githubusercontent.com/u/131427?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewvc","html_url":"https://github.com/andrewvc","followers_url":"https://api.github.com/users/andrewvc/followers","following_url":"https://api.github.com/users/andrewvc/following{/other_user}","gists_url":"https://api.github.com/users/andrewvc/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewvc/subscriptions","organizations_url":"https://api.github.com/users/andrewvc/orgs","repos_url":"https://api.github.com/users/andrewvc/repos","events_url":"https://api.github.com/users/andrewvc/events{/privacy}","received_events_url":"https://api.github.com/users/andrewvc/received_events","type":"User","site_admin":false},"body":"Oh, I thought it wasn't possible to get any more accurate without duplicating the code in ES itself. Am I incorrect? I'm glad to return that line.","created_at":"2015-11-12T18:56:55Z","updated_at":"2015-11-12T18:56:55Z","html_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29#discussion_r44698415","pull_request_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/comments/44698415"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29#discussion_r44698415"},"pull_request":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29","id":50339362,"html_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29","diff_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29.diff","patch_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29.patch","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/29","number":29,"state":"open","locked":false,"title":"Refactored to use common code from the non-java output!","user":{"login":"andrewvc","id":131427,"avatar_url":"https://avatars.githubusercontent.com/u/131427?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewvc","html_url":"https://github.com/andrewvc","followers_url":"https://api.github.com/users/andrewvc/followers","following_url":"https://api.github.com/users/andrewvc/following{/other_user}","gists_url":"https://api.github.com/users/andrewvc/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewvc/subscriptions","organizations_url":"https://api.github.com/users/andrewvc/orgs","repos_url":"https://api.github.com/users/andrewvc/repos","events_url":"https://api.github.com/users/andrewvc/events{/privacy}","received_events_url":"https://api.github.com/users/andrewvc/received_events","type":"User","site_admin":false},"body":"Depends on https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/302\r\nAll tests pass!","created_at":"2015-11-11T02:02:16Z","updated_at":"2015-11-12T18:56:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d27fd543a208375b505adaec39ea37022e921a50","assignee":{"login":"talevy","id":388837,"avatar_url":"https://avatars.githubusercontent.com/u/388837?v=3","gravatar_id":"","url":"https://api.github.com/users/talevy","html_url":"https://github.com/talevy","followers_url":"https://api.github.com/users/talevy/followers","following_url":"https://api.github.com/users/talevy/following{/other_user}","gists_url":"https://api.github.com/users/talevy/gists{/gist_id}","starred_url":"https://api.github.com/users/talevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talevy/subscriptions","organizations_url":"https://api.github.com/users/talevy/orgs","repos_url":"https://api.github.com/users/talevy/repos","events_url":"https://api.github.com/users/talevy/events{/privacy}","received_events_url":"https://api.github.com/users/talevy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29/commits","review_comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29/comments","review_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/29/comments","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/statuses/533896f98cfa36fd45b6cc5dfb38ee2218579cc2","head":{"label":"andrewvc:common_code","ref":"common_code","sha":"533896f98cfa36fd45b6cc5dfb38ee2218579cc2","user":{"login":"andrewvc","id":131427,"avatar_url":"https://avatars.githubusercontent.com/u/131427?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewvc","html_url":"https://github.com/andrewvc","followers_url":"https://api.github.com/users/andrewvc/followers","following_url":"https://api.github.com/users/andrewvc/following{/other_user}","gists_url":"https://api.github.com/users/andrewvc/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewvc/subscriptions","organizations_url":"https://api.github.com/users/andrewvc/orgs","repos_url":"https://api.github.com/users/andrewvc/repos","events_url":"https://api.github.com/users/andrewvc/events{/privacy}","received_events_url":"https://api.github.com/users/andrewvc/received_events","type":"User","site_admin":false},"repo":{"id":40146296,"name":"logstash-output-elasticsearch_java","full_name":"andrewvc/logstash-output-elasticsearch_java","owner":{"login":"andrewvc","id":131427,"avatar_url":"https://avatars.githubusercontent.com/u/131427?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewvc","html_url":"https://github.com/andrewvc","followers_url":"https://api.github.com/users/andrewvc/followers","following_url":"https://api.github.com/users/andrewvc/following{/other_user}","gists_url":"https://api.github.com/users/andrewvc/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewvc/subscriptions","organizations_url":"https://api.github.com/users/andrewvc/orgs","repos_url":"https://api.github.com/users/andrewvc/repos","events_url":"https://api.github.com/users/andrewvc/events{/privacy}","received_events_url":"https://api.github.com/users/andrewvc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andrewvc/logstash-output-elasticsearch_java","description":"WORK IN PROGRESS","fork":true,"url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java","forks_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/forks","keys_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/teams","hooks_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/hooks","issue_events_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/issues/events{/number}","events_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/events","assignees_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/assignees{/user}","branches_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/branches{/branch}","tags_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/tags","blobs_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/git/refs{/sha}","trees_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/statuses/{sha}","languages_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/languages","stargazers_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/stargazers","contributors_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/contributors","subscribers_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/subscribers","subscription_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/subscription","commits_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/commits{/sha}","git_commits_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/git/commits{/sha}","comments_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/comments{/number}","issue_comment_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/issues/comments{/number}","contents_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/contents/{+path}","compare_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/merges","archive_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/downloads","issues_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/issues{/number}","pulls_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/pulls{/number}","milestones_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/milestones{/number}","notifications_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/labels{/name}","releases_url":"https://api.github.com/repos/andrewvc/logstash-output-elasticsearch_java/releases{/id}","created_at":"2015-08-03T20:26:54Z","updated_at":"2015-08-28T14:51:23Z","pushed_at":"2015-11-11T02:00:56Z","git_url":"git://github.com/andrewvc/logstash-output-elasticsearch_java.git","ssh_url":"git@github.com:andrewvc/logstash-output-elasticsearch_java.git","clone_url":"https://github.com/andrewvc/logstash-output-elasticsearch_java.git","svn_url":"https://github.com/andrewvc/logstash-output-elasticsearch_java","homepage":null,"size":60028,"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":"925433c797ee1b92dc3db5cf0bd9a297729a2c81","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":40025778,"name":"logstash-output-elasticsearch_java","full_name":"logstash-plugins/logstash-output-elasticsearch_java","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-output-elasticsearch_java","description":"Java API Implementation of Elasticsearch Output","fork":false,"url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java","forks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/forks","keys_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/teams","hooks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/hooks","issue_events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/events{/number}","events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/events","assignees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/assignees{/user}","branches_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/branches{/branch}","tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/tags","blobs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/git/refs{/sha}","trees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/statuses/{sha}","languages_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/languages","stargazers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/stargazers","contributors_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/contributors","subscribers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/subscribers","subscription_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/subscription","commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/commits{/sha}","git_commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/git/commits{/sha}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/comments{/number}","issue_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/comments{/number}","contents_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/contents/{+path}","compare_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/merges","archive_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/downloads","issues_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues{/number}","pulls_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls{/number}","milestones_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/milestones{/number}","notifications_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/labels{/name}","releases_url":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/releases{/id}","created_at":"2015-07-31T21:34:17Z","updated_at":"2015-10-20T20:20:13Z","pushed_at":"2015-11-11T02:02:16Z","git_url":"git://github.com/logstash-plugins/logstash-output-elasticsearch_java.git","ssh_url":"git@github.com:logstash-plugins/logstash-output-elasticsearch_java.git","clone_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java.git","svn_url":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java","homepage":"","size":60102,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":12,"forks":4,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-elasticsearch_java/pull/29"},"issue":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/29"},"comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-elasticsearch_java/statuses/533896f98cfa36fd45b6cc5dfb38ee2218579cc2"}}}}