{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/37258501","id":37258501,"diff_hunk":"@@ -0,0 +1,156 @@\n+\"\"\"\n+DogStream parser capible of reading Apache Common and Combined logging formats.\n+\n+Parser will generate two metrics\n+1.) apache.net.requests\n+2.) apache.net.request_size\n+\n+Both metrics will be tagged with 'status' code family (2xx, 3xx, 4xx, 5xx, etc)\n+and HTTP 'verb' (GET, PUT, POST, etc)\n+\n+To parse common logs add the following to your agent configuration\n+dogstreams: /var/log/httpd/access.log:/etc/dd-agent/dogstream/apache.py:parse_common\n+\n+To parse combined logs add the following to your agent configuration\n+dogstreams: /var/log/httpd/access.log:/etc/dd-agent/dogstream/apache.py:parse_combined\n+\n+both config lines assume your logs are in /var/log/httpd/access.log and this file is\n+at /etc/dd-agent/dogstream/apache.py\n+\n+\"\"\"\n+import time\n+from datetime import datetime\n+import re\n+import math\n+","path":"dogstream/apache.py","position":25,"original_position":25,"commit_id":"380db76f1437a1f47cc45dcb3c812d7962aa4cab","original_commit_id":"380db76f1437a1f47cc45dcb3c812d7962aa4cab","user":{"login":"irabinovitch","id":289654,"avatar_url":"https://avatars.githubusercontent.com/u/289654?v=3","gravatar_id":"","url":"https://api.github.com/users/irabinovitch","html_url":"https://github.com/irabinovitch","followers_url":"https://api.github.com/users/irabinovitch/followers","following_url":"https://api.github.com/users/irabinovitch/following{/other_user}","gists_url":"https://api.github.com/users/irabinovitch/gists{/gist_id}","starred_url":"https://api.github.com/users/irabinovitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irabinovitch/subscriptions","organizations_url":"https://api.github.com/users/irabinovitch/orgs","repos_url":"https://api.github.com/users/irabinovitch/repos","events_url":"https://api.github.com/users/irabinovitch/events{/privacy}","received_events_url":"https://api.github.com/users/irabinovitch/received_events","type":"User","site_admin":false},"body":"Imported but not used. ","created_at":"2015-08-18T02:15:12Z","updated_at":"2015-08-18T02:15:12Z","html_url":"https://github.com/DataDog/dd-agent/pull/1837#discussion_r37258501","pull_request_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/37258501"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1837#discussion_r37258501"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837","id":42654600,"html_url":"https://github.com/DataDog/dd-agent/pull/1837","diff_url":"https://github.com/DataDog/dd-agent/pull/1837.diff","patch_url":"https://github.com/DataDog/dd-agent/pull/1837.patch","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1837","number":1837,"state":"open","locked":false,"title":"Apache common dogstream","user":{"login":"abruehl","id":2565081,"avatar_url":"https://avatars.githubusercontent.com/u/2565081?v=3","gravatar_id":"","url":"https://api.github.com/users/abruehl","html_url":"https://github.com/abruehl","followers_url":"https://api.github.com/users/abruehl/followers","following_url":"https://api.github.com/users/abruehl/following{/other_user}","gists_url":"https://api.github.com/users/abruehl/gists{/gist_id}","starred_url":"https://api.github.com/users/abruehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abruehl/subscriptions","organizations_url":"https://api.github.com/users/abruehl/orgs","repos_url":"https://api.github.com/users/abruehl/repos","events_url":"https://api.github.com/users/abruehl/events{/privacy}","received_events_url":"https://api.github.com/users/abruehl/received_events","type":"User","site_admin":false},"body":"An example dogstream parser for apache common and combined log format.  \r\nIt's rough but works just fine.  \r\n\r\nCreates two metrics\r\napache.net.requests\r\napache.net.request_size\r\n\r\nThese metrics are tagged by verb (get, post, put, etc...) and status code family (2xx, 3xx, 4xx, etc)\r\n\r\n","created_at":"2015-08-18T02:09:18Z","updated_at":"2015-08-18T02:15:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"818df50e8ecec6a97ebb8d17dccaec966a8931e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1837/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/380db76f1437a1f47cc45dcb3c812d7962aa4cab","head":{"label":"abruehl:apache_common_dogstream","ref":"apache_common_dogstream","sha":"380db76f1437a1f47cc45dcb3c812d7962aa4cab","user":{"login":"abruehl","id":2565081,"avatar_url":"https://avatars.githubusercontent.com/u/2565081?v=3","gravatar_id":"","url":"https://api.github.com/users/abruehl","html_url":"https://github.com/abruehl","followers_url":"https://api.github.com/users/abruehl/followers","following_url":"https://api.github.com/users/abruehl/following{/other_user}","gists_url":"https://api.github.com/users/abruehl/gists{/gist_id}","starred_url":"https://api.github.com/users/abruehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abruehl/subscriptions","organizations_url":"https://api.github.com/users/abruehl/orgs","repos_url":"https://api.github.com/users/abruehl/repos","events_url":"https://api.github.com/users/abruehl/events{/privacy}","received_events_url":"https://api.github.com/users/abruehl/received_events","type":"User","site_admin":false},"repo":{"id":40603010,"name":"dd-agent","full_name":"abruehl/dd-agent","owner":{"login":"abruehl","id":2565081,"avatar_url":"https://avatars.githubusercontent.com/u/2565081?v=3","gravatar_id":"","url":"https://api.github.com/users/abruehl","html_url":"https://github.com/abruehl","followers_url":"https://api.github.com/users/abruehl/followers","following_url":"https://api.github.com/users/abruehl/following{/other_user}","gists_url":"https://api.github.com/users/abruehl/gists{/gist_id}","starred_url":"https://api.github.com/users/abruehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abruehl/subscriptions","organizations_url":"https://api.github.com/users/abruehl/orgs","repos_url":"https://api.github.com/users/abruehl/repos","events_url":"https://api.github.com/users/abruehl/events{/privacy}","received_events_url":"https://api.github.com/users/abruehl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abruehl/dd-agent","description":"Datadog Agent","fork":true,"url":"https://api.github.com/repos/abruehl/dd-agent","forks_url":"https://api.github.com/repos/abruehl/dd-agent/forks","keys_url":"https://api.github.com/repos/abruehl/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abruehl/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abruehl/dd-agent/teams","hooks_url":"https://api.github.com/repos/abruehl/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/abruehl/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/abruehl/dd-agent/events","assignees_url":"https://api.github.com/repos/abruehl/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/abruehl/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/abruehl/dd-agent/tags","blobs_url":"https://api.github.com/repos/abruehl/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abruehl/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abruehl/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/abruehl/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abruehl/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/abruehl/dd-agent/languages","stargazers_url":"https://api.github.com/repos/abruehl/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/abruehl/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/abruehl/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/abruehl/dd-agent/subscription","commits_url":"https://api.github.com/repos/abruehl/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/abruehl/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/abruehl/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/abruehl/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/abruehl/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/abruehl/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abruehl/dd-agent/merges","archive_url":"https://api.github.com/repos/abruehl/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abruehl/dd-agent/downloads","issues_url":"https://api.github.com/repos/abruehl/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/abruehl/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/abruehl/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/abruehl/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abruehl/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/abruehl/dd-agent/releases{/id}","created_at":"2015-08-12T13:44:46Z","updated_at":"2015-08-12T13:44:48Z","pushed_at":"2015-08-18T02:05:54Z","git_url":"git://github.com/abruehl/dd-agent.git","ssh_url":"git@github.com:abruehl/dd-agent.git","clone_url":"https://github.com/abruehl/dd-agent.git","svn_url":"https://github.com/abruehl/dd-agent","homepage":"http://docs.datadoghq.com/","size":29238,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"59ac9dae196c0e5cbe6509dd606c94b7c1d8422c","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2015-08-15T10:06:22Z","pushed_at":"2015-08-18T02:09:18Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":52196,"stargazers_count":320,"watchers_count":320,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":262,"mirror_url":null,"open_issues_count":179,"forks":262,"open_issues":179,"watchers":320,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1837"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1837"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1837/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1837/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-agent/statuses/380db76f1437a1f47cc45dcb3c812d7962aa4cab"}}}}