{"action":"opened","number":1,"pull_request":{"url":"https://api.github.com/repos/portante/rsyslog/pulls/1","id":172293690,"html_url":"https://github.com/portante/rsyslog/pull/1","diff_url":"https://github.com/portante/rsyslog/pull/1.diff","patch_url":"https://github.com/portante/rsyslog/pull/1.patch","issue_url":"https://api.github.com/repos/portante/rsyslog/issues/1","number":1,"state":"open","locked":false,"title":"Kubernetes Metadata plugin - mmkubernetes","user":{"login":"richm","id":23066,"avatar_url":"https://avatars2.githubusercontent.com/u/23066?v=4","gravatar_id":"","url":"https://api.github.com/users/richm","html_url":"https://github.com/richm","followers_url":"https://api.github.com/users/richm/followers","following_url":"https://api.github.com/users/richm/following{/other_user}","gists_url":"https://api.github.com/users/richm/gists{/gist_id}","starred_url":"https://api.github.com/users/richm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richm/subscriptions","organizations_url":"https://api.github.com/users/richm/orgs","repos_url":"https://api.github.com/users/richm/repos","events_url":"https://api.github.com/users/richm/events{/privacy}","received_events_url":"https://api.github.com/users/richm/received_events","type":"User","site_admin":false},"body":"This plugin is used to annotate records logged by Kubernetes containers.\r\nIt will add the namespace uuid, pod uuid, pod and namespace labels and\r\nannotations, and other metadata associated with the pod and namespace.\r\nIt will work with either log files in `/var/log/containers/*.log` or\r\nwith journald entries with `CONTAINER_NAME` and `CONTAINER_ID_FULL`.\r\n\r\nFor file logs, the filename must match this regex:\r\n\r\n    /var/log/containers/([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_([^_]+)_(.+)-([a-z0-9]{64})\\\\.log$\r\n\r\nThe first match is the pod name, the second is the container hash (not\r\ncurrently used), the third is the namespace name, the fourth is the\r\ncontainer name, and the fifth is the container id.  You can specify a\r\ndifferent regex by using the module or action configuration parameter\r\n`filenameregex` but keep in mind that the field positions are hardcoded\r\nso the regex must have the same fields in the same order.\r\n\r\nFor journald logs, there must be a field `CONTAINER_NAME` which matches this:\r\n\r\n    ^[^_]+_([^\\\\._]+)(\\\\.([^_]+))?_([^_]+)_([^_]+)_[^_]+_[^_]+$\r\n\r\nThe first match is the container name, the second is the container hash\r\n(not currently used), the third is the pod name, and the fourth is the\r\nnamespace name.  The record must also have the field `CONTAINER_ID_FULL`.\r\nYou can specify a different regex by using the module or action\r\nconfiguration parameter `containerregex` but keep in mind that the field\r\npositions are hardcoded so the regex must have the same fields in the same\r\norder.\r\n\r\nThe Kubernetes metadata is added to the record in the top-level\r\nfields `kubernetes` and `docker`.\r\nSee https://github.com/ViaQ/elasticsearch-templates/blob/master/namespaces/kubernetes.yml\r\nand\r\nhttps://github.com/ViaQ/elasticsearch-templates/blob/master/namespaces/docker.yml\r\nfor more details.\r\n\r\n*Configuration*\r\n`kubernetesurl` - Required - URL of the Kubernetes API server e.g.\r\n                  `https://localhost:8443`\r\n`tls.cacert` - Required - full path and file name of file containing\r\n               the CA cert of the Kubernetes API server cert issuer\r\n`tokenfile` - Required (or `token`) - the file containing the token\r\n              to use to authenticate to the Kubernetes API server\r\n`token` - Required (or `tokenfile`) - the token to use to\r\n          authenticate to the Kubernetes API server\r\n`annotation_match` - Optional - by default no pod or namespace annotations\r\n                     will be added to the records - this parameter is an\r\n                     array of patterns to match the keys of the `annotations`\r\n                     field to include in the `annotations` field or the\r\n                     `namespace_annotations` field.\r\n\r\n*Example*\r\n\r\n    module(load=\"imfile\" mode=\"inotify\")\r\n    module(load=\"mmkubernetes\" kubernetesurl=\"https://localhost:8443\"\r\n           tls.cacert=\"/etc/rsyslog.d/mmk8s.ca.crt\"\r\n           tokenfile=\"/etc/rsyslog.d/mmk8s.token\" annotation_match=[\".\"])\r\n\r\n    template(name=\"tpl\" type=\"list\") {\r\n        property(name=\"jsonmesg\")\r\n        constant(value=\"\\n\")\r\n    }\r\n\r\n    ruleset(name=\"k8s\") {\r\n        action(type=\"mmkubernetes\")\r\n        action(type=\"omfile\" file=\"/var/log/k8s.log\" template=\"tpl\")\r\n    }\r\n\r\n    input(type=\"imfile\" file=\"/var/log/containers/*.log\" tag=\"kubernetes\" addmetadata=\"on\" ruleset=\"k8s\")\r\n    if ($!_SYSTEMD_UNIT == \"docker.service\") and (strlen($!CONTAINER_NAME) > 0) then {\r\n        call k8s\r\n    }\r\n\r\n*Credits*\r\nThis work is based on https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter\r\nand has many of the same features.","created_at":"2018-03-01T16:53:41Z","updated_at":"2018-03-01T16:53:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/portante/rsyslog/pulls/1/commits","review_comments_url":"https://api.github.com/repos/portante/rsyslog/pulls/1/comments","review_comment_url":"https://api.github.com/repos/portante/rsyslog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portante/rsyslog/issues/1/comments","statuses_url":"https://api.github.com/repos/portante/rsyslog/statuses/f9cf7310eceaf143f1d88971702a4bfbfa4e2f19","head":{"label":"richm:mmk8s","ref":"mmk8s","sha":"f9cf7310eceaf143f1d88971702a4bfbfa4e2f19","user":{"login":"richm","id":23066,"avatar_url":"https://avatars2.githubusercontent.com/u/23066?v=4","gravatar_id":"","url":"https://api.github.com/users/richm","html_url":"https://github.com/richm","followers_url":"https://api.github.com/users/richm/followers","following_url":"https://api.github.com/users/richm/following{/other_user}","gists_url":"https://api.github.com/users/richm/gists{/gist_id}","starred_url":"https://api.github.com/users/richm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richm/subscriptions","organizations_url":"https://api.github.com/users/richm/orgs","repos_url":"https://api.github.com/users/richm/repos","events_url":"https://api.github.com/users/richm/events{/privacy}","received_events_url":"https://api.github.com/users/richm/received_events","type":"User","site_admin":false},"repo":{"id":49724673,"name":"rsyslog","full_name":"richm/rsyslog","owner":{"login":"richm","id":23066,"avatar_url":"https://avatars2.githubusercontent.com/u/23066?v=4","gravatar_id":"","url":"https://api.github.com/users/richm","html_url":"https://github.com/richm","followers_url":"https://api.github.com/users/richm/followers","following_url":"https://api.github.com/users/richm/following{/other_user}","gists_url":"https://api.github.com/users/richm/gists{/gist_id}","starred_url":"https://api.github.com/users/richm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richm/subscriptions","organizations_url":"https://api.github.com/users/richm/orgs","repos_url":"https://api.github.com/users/richm/repos","events_url":"https://api.github.com/users/richm/events{/privacy}","received_events_url":"https://api.github.com/users/richm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/richm/rsyslog","description":"a Rocket-fast SYStem for LOG processing","fork":true,"url":"https://api.github.com/repos/richm/rsyslog","forks_url":"https://api.github.com/repos/richm/rsyslog/forks","keys_url":"https://api.github.com/repos/richm/rsyslog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/richm/rsyslog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/richm/rsyslog/teams","hooks_url":"https://api.github.com/repos/richm/rsyslog/hooks","issue_events_url":"https://api.github.com/repos/richm/rsyslog/issues/events{/number}","events_url":"https://api.github.com/repos/richm/rsyslog/events","assignees_url":"https://api.github.com/repos/richm/rsyslog/assignees{/user}","branches_url":"https://api.github.com/repos/richm/rsyslog/branches{/branch}","tags_url":"https://api.github.com/repos/richm/rsyslog/tags","blobs_url":"https://api.github.com/repos/richm/rsyslog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/richm/rsyslog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/richm/rsyslog/git/refs{/sha}","trees_url":"https://api.github.com/repos/richm/rsyslog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/richm/rsyslog/statuses/{sha}","languages_url":"https://api.github.com/repos/richm/rsyslog/languages","stargazers_url":"https://api.github.com/repos/richm/rsyslog/stargazers","contributors_url":"https://api.github.com/repos/richm/rsyslog/contributors","subscribers_url":"https://api.github.com/repos/richm/rsyslog/subscribers","subscription_url":"https://api.github.com/repos/richm/rsyslog/subscription","commits_url":"https://api.github.com/repos/richm/rsyslog/commits{/sha}","git_commits_url":"https://api.github.com/repos/richm/rsyslog/git/commits{/sha}","comments_url":"https://api.github.com/repos/richm/rsyslog/comments{/number}","issue_comment_url":"https://api.github.com/repos/richm/rsyslog/issues/comments{/number}","contents_url":"https://api.github.com/repos/richm/rsyslog/contents/{+path}","compare_url":"https://api.github.com/repos/richm/rsyslog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/richm/rsyslog/merges","archive_url":"https://api.github.com/repos/richm/rsyslog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/richm/rsyslog/downloads","issues_url":"https://api.github.com/repos/richm/rsyslog/issues{/number}","pulls_url":"https://api.github.com/repos/richm/rsyslog/pulls{/number}","milestones_url":"https://api.github.com/repos/richm/rsyslog/milestones{/number}","notifications_url":"https://api.github.com/repos/richm/rsyslog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/richm/rsyslog/labels{/name}","releases_url":"https://api.github.com/repos/richm/rsyslog/releases{/id}","deployments_url":"https://api.github.com/repos/richm/rsyslog/deployments","created_at":"2016-01-15T14:48:55Z","updated_at":"2016-07-06T19:17:40Z","pushed_at":"2018-03-01T16:52:54Z","git_url":"git://github.com/richm/rsyslog.git","ssh_url":"git@github.com:richm/rsyslog.git","clone_url":"https://github.com/richm/rsyslog.git","svn_url":"https://github.com/richm/rsyslog","homepage":"http://www.rsyslog.com","size":42542,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"portante:mmk8s","ref":"mmk8s","sha":"bacfd7cf9e6ef0aa5f9b65eb1dfaed2f42d3747b","user":{"login":"portante","id":949097,"avatar_url":"https://avatars2.githubusercontent.com/u/949097?v=4","gravatar_id":"","url":"https://api.github.com/users/portante","html_url":"https://github.com/portante","followers_url":"https://api.github.com/users/portante/followers","following_url":"https://api.github.com/users/portante/following{/other_user}","gists_url":"https://api.github.com/users/portante/gists{/gist_id}","starred_url":"https://api.github.com/users/portante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portante/subscriptions","organizations_url":"https://api.github.com/users/portante/orgs","repos_url":"https://api.github.com/users/portante/repos","events_url":"https://api.github.com/users/portante/events{/privacy}","received_events_url":"https://api.github.com/users/portante/received_events","type":"User","site_admin":false},"repo":{"id":46147031,"name":"rsyslog","full_name":"portante/rsyslog","owner":{"login":"portante","id":949097,"avatar_url":"https://avatars2.githubusercontent.com/u/949097?v=4","gravatar_id":"","url":"https://api.github.com/users/portante","html_url":"https://github.com/portante","followers_url":"https://api.github.com/users/portante/followers","following_url":"https://api.github.com/users/portante/following{/other_user}","gists_url":"https://api.github.com/users/portante/gists{/gist_id}","starred_url":"https://api.github.com/users/portante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portante/subscriptions","organizations_url":"https://api.github.com/users/portante/orgs","repos_url":"https://api.github.com/users/portante/repos","events_url":"https://api.github.com/users/portante/events{/privacy}","received_events_url":"https://api.github.com/users/portante/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/portante/rsyslog","description":"a Rocket-fast SYStem for LOG processing","fork":true,"url":"https://api.github.com/repos/portante/rsyslog","forks_url":"https://api.github.com/repos/portante/rsyslog/forks","keys_url":"https://api.github.com/repos/portante/rsyslog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portante/rsyslog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portante/rsyslog/teams","hooks_url":"https://api.github.com/repos/portante/rsyslog/hooks","issue_events_url":"https://api.github.com/repos/portante/rsyslog/issues/events{/number}","events_url":"https://api.github.com/repos/portante/rsyslog/events","assignees_url":"https://api.github.com/repos/portante/rsyslog/assignees{/user}","branches_url":"https://api.github.com/repos/portante/rsyslog/branches{/branch}","tags_url":"https://api.github.com/repos/portante/rsyslog/tags","blobs_url":"https://api.github.com/repos/portante/rsyslog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portante/rsyslog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portante/rsyslog/git/refs{/sha}","trees_url":"https://api.github.com/repos/portante/rsyslog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portante/rsyslog/statuses/{sha}","languages_url":"https://api.github.com/repos/portante/rsyslog/languages","stargazers_url":"https://api.github.com/repos/portante/rsyslog/stargazers","contributors_url":"https://api.github.com/repos/portante/rsyslog/contributors","subscribers_url":"https://api.github.com/repos/portante/rsyslog/subscribers","subscription_url":"https://api.github.com/repos/portante/rsyslog/subscription","commits_url":"https://api.github.com/repos/portante/rsyslog/commits{/sha}","git_commits_url":"https://api.github.com/repos/portante/rsyslog/git/commits{/sha}","comments_url":"https://api.github.com/repos/portante/rsyslog/comments{/number}","issue_comment_url":"https://api.github.com/repos/portante/rsyslog/issues/comments{/number}","contents_url":"https://api.github.com/repos/portante/rsyslog/contents/{+path}","compare_url":"https://api.github.com/repos/portante/rsyslog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portante/rsyslog/merges","archive_url":"https://api.github.com/repos/portante/rsyslog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portante/rsyslog/downloads","issues_url":"https://api.github.com/repos/portante/rsyslog/issues{/number}","pulls_url":"https://api.github.com/repos/portante/rsyslog/pulls{/number}","milestones_url":"https://api.github.com/repos/portante/rsyslog/milestones{/number}","notifications_url":"https://api.github.com/repos/portante/rsyslog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portante/rsyslog/labels{/name}","releases_url":"https://api.github.com/repos/portante/rsyslog/releases{/id}","deployments_url":"https://api.github.com/repos/portante/rsyslog/deployments","created_at":"2015-11-13T21:01:37Z","updated_at":"2015-11-13T21:01:46Z","pushed_at":"2018-02-08T17:07:24Z","git_url":"git://github.com/portante/rsyslog.git","ssh_url":"git@github.com:portante/rsyslog.git","clone_url":"https://github.com/portante/rsyslog.git","svn_url":"https://github.com/portante/rsyslog","homepage":"http://www.rsyslog.com","size":47058,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portante/rsyslog/pulls/1"},"html":{"href":"https://github.com/portante/rsyslog/pull/1"},"issue":{"href":"https://api.github.com/repos/portante/rsyslog/issues/1"},"comments":{"href":"https://api.github.com/repos/portante/rsyslog/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/portante/rsyslog/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/portante/rsyslog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portante/rsyslog/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/portante/rsyslog/statuses/f9cf7310eceaf143f1d88971702a4bfbfa4e2f19"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":638,"deletions":76,"changed_files":2}}
{"actor":{"display_login":"richm"}}