{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/elastalert/pulls/comments/26704354","id":26704354,"diff_hunk":"@@ -157,6 +157,10 @@ def load_configuration(filename):\n     include.append(rule['timestamp_field'])\n     rule['include'] = list(set(include))\n \n+    # Change top_count_keys to .raw\n+    if 'top_count_keys' in rule and rule.get('raw_count_keys', True):\n+        rule['top_count_keys'] = [key + '.raw' if not key.endswith('.raw') else key for key in rule.get('top_count_keys')]","path":"elastalert/config.py","position":6,"original_position":6,"commit_id":"a82e8700bb62a6440d0d03e7a70dde77e0ae59bf","original_commit_id":"084cca8a3d977eb0a262f50f5f12d95bd3c015e2","user":{"login":"y-trobinso","id":2644744,"avatar_url":"https://avatars.githubusercontent.com/u/2644744?v=3","gravatar_id":"","url":"https://api.github.com/users/y-trobinso","html_url":"https://github.com/y-trobinso","followers_url":"https://api.github.com/users/y-trobinso/followers","following_url":"https://api.github.com/users/y-trobinso/following{/other_user}","gists_url":"https://api.github.com/users/y-trobinso/gists{/gist_id}","starred_url":"https://api.github.com/users/y-trobinso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-trobinso/subscriptions","organizations_url":"https://api.github.com/users/y-trobinso/orgs","repos_url":"https://api.github.com/users/y-trobinso/repos","events_url":"https://api.github.com/users/y-trobinso/events{/privacy}","received_events_url":"https://api.github.com/users/y-trobinso/received_events","type":"User","site_admin":false},"body":"Long line. Otherwise seems fine.","created_at":"2015-03-18T20:34:32Z","updated_at":"2015-03-18T20:34:32Z","html_url":"https://github.com/Yelp/elastalert/pull/29#discussion_r26704354","pull_request_url":"https://api.github.com/repos/Yelp/elastalert/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/comments/26704354"},"html":{"href":"https://github.com/Yelp/elastalert/pull/29#discussion_r26704354"},"pull_request":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/elastalert/pulls/29","id":31468317,"html_url":"https://github.com/Yelp/elastalert/pull/29","diff_url":"https://github.com/Yelp/elastalert/pull/29.diff","patch_url":"https://github.com/Yelp/elastalert/pull/29.patch","issue_url":"https://api.github.com/repos/Yelp/elastalert/issues/29","number":29,"state":"open","locked":false,"title":"Top count bug fix","user":{"login":"Qmando","id":3246990,"avatar_url":"https://avatars.githubusercontent.com/u/3246990?v=3","gravatar_id":"","url":"https://api.github.com/users/Qmando","html_url":"https://github.com/Qmando","followers_url":"https://api.github.com/users/Qmando/followers","following_url":"https://api.github.com/users/Qmando/following{/other_user}","gists_url":"https://api.github.com/users/Qmando/gists{/gist_id}","starred_url":"https://api.github.com/users/Qmando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qmando/subscriptions","organizations_url":"https://api.github.com/users/Qmando/orgs","repos_url":"https://api.github.com/users/Qmando/repos","events_url":"https://api.github.com/users/Qmando/events{/privacy}","received_events_url":"https://api.github.com/users/Qmando/received_events","type":"User","site_admin":false},"body":"Couple of fixes/features here:\r\n\r\n1. Match timestamp fields are properly converted before calling get_top_counts\r\n2. Query key is filtered by '.raw' field. With an analyzed field, passing the data to a term filter can result in an unexpected lack of hits.\r\n3. Similarly, top_count_keys are defaulted to '.raw'. This is because otherwise they often come up as\r\n\"this\": 5\r\n\"field\": 5\r\n\"is\": 5\r\n\"analyzed\": 5\r\n\r\ninstead of\r\n\r\n\"this field is analyzed\": 5","created_at":"2015-03-18T20:24:27Z","updated_at":"2015-03-18T20:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37fadda81c4a1cc2af8c18c3e6bfda679a4c9c70","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/elastalert/pulls/29/commits","review_comments_url":"https://api.github.com/repos/Yelp/elastalert/pulls/29/comments","review_comment_url":"https://api.github.com/repos/Yelp/elastalert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/elastalert/issues/29/comments","statuses_url":"https://api.github.com/repos/Yelp/elastalert/statuses/a82e8700bb62a6440d0d03e7a70dde77e0ae59bf","head":{"label":"Yelp:top_count_bug_fix","ref":"top_count_bug_fix","sha":"a82e8700bb62a6440d0d03e7a70dde77e0ae59bf","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":27091760,"name":"elastalert","full_name":"Yelp/elastalert","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/elastalert","description":"Easy & Flexible Alerting With ElasticSearch","fork":false,"url":"https://api.github.com/repos/Yelp/elastalert","forks_url":"https://api.github.com/repos/Yelp/elastalert/forks","keys_url":"https://api.github.com/repos/Yelp/elastalert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/elastalert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/elastalert/teams","hooks_url":"https://api.github.com/repos/Yelp/elastalert/hooks","issue_events_url":"https://api.github.com/repos/Yelp/elastalert/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/elastalert/events","assignees_url":"https://api.github.com/repos/Yelp/elastalert/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/elastalert/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/elastalert/tags","blobs_url":"https://api.github.com/repos/Yelp/elastalert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/elastalert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/elastalert/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/elastalert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/elastalert/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/elastalert/languages","stargazers_url":"https://api.github.com/repos/Yelp/elastalert/stargazers","contributors_url":"https://api.github.com/repos/Yelp/elastalert/contributors","subscribers_url":"https://api.github.com/repos/Yelp/elastalert/subscribers","subscription_url":"https://api.github.com/repos/Yelp/elastalert/subscription","commits_url":"https://api.github.com/repos/Yelp/elastalert/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/elastalert/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/elastalert/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/elastalert/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/elastalert/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/elastalert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/elastalert/merges","archive_url":"https://api.github.com/repos/Yelp/elastalert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/elastalert/downloads","issues_url":"https://api.github.com/repos/Yelp/elastalert/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/elastalert/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/elastalert/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/elastalert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/elastalert/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/elastalert/releases{/id}","created_at":"2014-11-24T19:39:19Z","updated_at":"2015-03-18T15:39:20Z","pushed_at":"2015-03-18T20:32:18Z","git_url":"git://github.com/Yelp/elastalert.git","ssh_url":"git@github.com:Yelp/elastalert.git","clone_url":"https://github.com/Yelp/elastalert.git","svn_url":"https://github.com/Yelp/elastalert","homepage":"https://elastalert.readthedocs.org","size":788,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":20,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"20ffd3d6304903bca079e88862eea256e1e8b8c7","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":27091760,"name":"elastalert","full_name":"Yelp/elastalert","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/elastalert","description":"Easy & Flexible Alerting With ElasticSearch","fork":false,"url":"https://api.github.com/repos/Yelp/elastalert","forks_url":"https://api.github.com/repos/Yelp/elastalert/forks","keys_url":"https://api.github.com/repos/Yelp/elastalert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/elastalert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/elastalert/teams","hooks_url":"https://api.github.com/repos/Yelp/elastalert/hooks","issue_events_url":"https://api.github.com/repos/Yelp/elastalert/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/elastalert/events","assignees_url":"https://api.github.com/repos/Yelp/elastalert/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/elastalert/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/elastalert/tags","blobs_url":"https://api.github.com/repos/Yelp/elastalert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/elastalert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/elastalert/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/elastalert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/elastalert/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/elastalert/languages","stargazers_url":"https://api.github.com/repos/Yelp/elastalert/stargazers","contributors_url":"https://api.github.com/repos/Yelp/elastalert/contributors","subscribers_url":"https://api.github.com/repos/Yelp/elastalert/subscribers","subscription_url":"https://api.github.com/repos/Yelp/elastalert/subscription","commits_url":"https://api.github.com/repos/Yelp/elastalert/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/elastalert/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/elastalert/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/elastalert/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/elastalert/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/elastalert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/elastalert/merges","archive_url":"https://api.github.com/repos/Yelp/elastalert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/elastalert/downloads","issues_url":"https://api.github.com/repos/Yelp/elastalert/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/elastalert/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/elastalert/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/elastalert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/elastalert/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/elastalert/releases{/id}","created_at":"2014-11-24T19:39:19Z","updated_at":"2015-03-18T15:39:20Z","pushed_at":"2015-03-18T20:32:18Z","git_url":"git://github.com/Yelp/elastalert.git","ssh_url":"git@github.com:Yelp/elastalert.git","clone_url":"https://github.com/Yelp/elastalert.git","svn_url":"https://github.com/Yelp/elastalert","homepage":"https://elastalert.readthedocs.org","size":788,"stargazers_count":20,"watchers_count":20,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":17,"forks":2,"open_issues":17,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/29"},"html":{"href":"https://github.com/Yelp/elastalert/pull/29"},"issue":{"href":"https://api.github.com/repos/Yelp/elastalert/issues/29"},"comments":{"href":"https://api.github.com/repos/Yelp/elastalert/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/elastalert/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/elastalert/statuses/a82e8700bb62a6440d0d03e7a70dde77e0ae59bf"}}}}