{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-services/heka/issues/1546","labels_url":"https://api.github.com/repos/mozilla-services/heka/issues/1546/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-services/heka/issues/1546/comments","events_url":"https://api.github.com/repos/mozilla-services/heka/issues/1546/events","html_url":"https://github.com/mozilla-services/heka/pull/1546","id":78465771,"number":1546,"title":"Allow to overwrite the ContainerName using a Container Environment Variable. Issue 1545","user":{"login":"fernandezvara","id":358493,"avatar_url":"https://avatars.githubusercontent.com/u/358493?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandezvara","html_url":"https://github.com/fernandezvara","followers_url":"https://api.github.com/users/fernandezvara/followers","following_url":"https://api.github.com/users/fernandezvara/following{/other_user}","gists_url":"https://api.github.com/users/fernandezvara/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandezvara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandezvara/subscriptions","organizations_url":"https://api.github.com/users/fernandezvara/orgs","repos_url":"https://api.github.com/users/fernandezvara/repos","events_url":"https://api.github.com/users/fernandezvara/events{/privacy}","received_events_url":"https://api.github.com/users/fernandezvara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-20T10:22:13Z","updated_at":"2015-05-20T22:45:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla-services/heka/pulls/1546","html_url":"https://github.com/mozilla-services/heka/pull/1546","diff_url":"https://github.com/mozilla-services/heka/pull/1546.diff","patch_url":"https://github.com/mozilla-services/heka/pull/1546.patch"},"body":"This pull request allow to set in the DockerLogInput a configuration to set the ContainerName using an arbitrary environment variable defined inside the container. Refers to issue https://github.com/mozilla-services/heka/issues/1545\r\n\r\nIf the environment variable defined on the configuration is not set, it uses the ContainerName instead.\r\n\r\nAdded on the configuration a new entry name_from_env_var that allows to select the desired variable to use.\r\n\r\nSample configuration: \r\n\r\n(This sample is useful to get the mesos task id instead of the container name, since using Mesos/Marathon the container name does not match the marathon id)\r\n\r\n```toml\r\n[hekad]\r\nmaxprocs = 2\r\n\r\n[Dashboard]\r\ntype = \"DashboardOutput\"\r\naddress = \":4352\"\r\nticker_interval = 15\r\n\r\n[DockerLogInput]\r\nname_from_env_var = \"MESOS_TASK_ID\"\r\n\r\n[influxdb]\r\ntype = \"SandboxEncoder\"\r\nfilename = \"lua_encoders/schema_influx.lua\"\r\n\r\n    [influxdb.config]\r\n    series = \"docker\"\r\n    skip_fields = \"Pid EnvVersion Severity Type\"\r\n\r\n[InfluxOutput]\r\nmessage_matcher = \"Type == 'DockerLog'\"\r\nencoder = \"influxdb\"\r\ntype = \"HttpOutput\"\r\naddress = \"http://10.10.10.10:31002/db/logs/series\"\r\nusername = \"root\"\r\npassword = \"root\"\r\n```"},"comment":{"url":"https://api.github.com/repos/mozilla-services/heka/issues/comments/104064826","html_url":"https://github.com/mozilla-services/heka/pull/1546#issuecomment-104064826","issue_url":"https://api.github.com/repos/mozilla-services/heka/issues/1546","id":104064826,"user":{"login":"rafrombrc","id":151364,"avatar_url":"https://avatars.githubusercontent.com/u/151364?v=3","gravatar_id":"","url":"https://api.github.com/users/rafrombrc","html_url":"https://github.com/rafrombrc","followers_url":"https://api.github.com/users/rafrombrc/followers","following_url":"https://api.github.com/users/rafrombrc/following{/other_user}","gists_url":"https://api.github.com/users/rafrombrc/gists{/gist_id}","starred_url":"https://api.github.com/users/rafrombrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafrombrc/subscriptions","organizations_url":"https://api.github.com/users/rafrombrc/orgs","repos_url":"https://api.github.com/users/rafrombrc/repos","events_url":"https://api.github.com/users/rafrombrc/events{/privacy}","received_events_url":"https://api.github.com/users/rafrombrc/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T22:45:19Z","updated_at":"2015-05-20T22:45:19Z","body":"This looks great, thanks! Before I can merge it there needs to be an entry added to the 'features' section for version 0.10.0 of the CHANGES.txt changelog, and the docker_log.rst documentation file needs to be updated to include the new setting."}}