{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/3372","repository_url":"https://api.github.com/repos/influxdata/telegraf","labels_url":"https://api.github.com/repos/influxdata/telegraf/issues/3372/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/3372/comments","events_url":"https://api.github.com/repos/influxdata/telegraf/issues/3372/events","html_url":"https://github.com/influxdata/telegraf/issues/3372","id":267367896,"number":3372,"title":"ability to re-write tags as fields","user":{"login":"lqueryvg","id":5748327,"avatar_url":"https://avatars3.githubusercontent.com/u/5748327?v=4","gravatar_id":"","url":"https://api.github.com/users/lqueryvg","html_url":"https://github.com/lqueryvg","followers_url":"https://api.github.com/users/lqueryvg/followers","following_url":"https://api.github.com/users/lqueryvg/following{/other_user}","gists_url":"https://api.github.com/users/lqueryvg/gists{/gist_id}","starred_url":"https://api.github.com/users/lqueryvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lqueryvg/subscriptions","organizations_url":"https://api.github.com/users/lqueryvg/orgs","repos_url":"https://api.github.com/users/lqueryvg/repos","events_url":"https://api.github.com/users/lqueryvg/events{/privacy}","received_events_url":"https://api.github.com/users/lqueryvg/received_events","type":"User","site_admin":false},"labels":[{"id":435014499,"url":"https://api.github.com/repos/influxdata/telegraf/labels/feature%20request","name":"feature request","color":"513cc6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-21T09:58:09Z","updated_at":"2018-04-24T18:57:34Z","closed_at":null,"author_association":"NONE","body":"### System info:\r\n\r\nTelegraf v1.3.4\r\nUbuntu 16.04\r\n\r\n## Feature Request\r\n\r\nProvide a way to re-write tags as fields.\r\n\r\nExample line output (I've added spaces and newlines for readability):\r\n\r\n```\r\ndocker_container_cpu,\r\ncontainer_version=3.0,\r\nio.kubernetes.pod.terminationGracePeriod=30,\r\nio.kubernetes.container.hash=d8dbe16c,\r\nio.kubernetes.pod.namespace=default,\r\nenv=test,\r\ncontainer_image=gcr.io/google_containers/pause-amd64,\r\nio.kubernetes.container.name=customer,\r\nengine_host=kube-nodehost-78888485,\r\ncontainer_name=k8s_POD.d8dbe16c_customer-2889827281-c5hmv_default_9aa582d0-b279-11e7-b6c4-000d3a283041_e3091511,\r\nio.kubernetes.container.restartCount=0,\r\nio.kubernetes.pod.uid=9aa582d0-b279-11e7-b6c4-000d3a283041,\r\nhost=kube-nodehost-78888485,\r\nio.kubernetes.pod.name=customer-2889827281-c5hmv,\r\ncpu=cpu1 \r\n\r\nusage_total=4536344i,\r\ncontainer_id=\"1faaef7d3afbd86f22af227f0ad11c088f743406e5240910a20a775c139e9d5b\" \r\n\r\n1508577843000000000\r\n```\r\n\r\nIn the above, everything except `usage_total` and `container_id` is a tag. Many of these tags should really be fields because:\r\n- they vary so much that it makes no sense to index them\r\n- the indexes consume a *lot* of memory on the influxdb server\r\n\r\nFor example all of the following should  be fields, not tags:\r\n\r\n```\r\ncontainer_name\r\npod.name\r\nio.kubernetes.container.restartCount\r\nio.kubernetes.pod.uid\r\n```\r\n\r\n### Proposal:\r\n\r\nAllow user to provide a list of tags in `telegraf.conf` which should be converted to fields.\r\nE.g.\r\n```\r\n    tags_to_fields = [ \"container_name\", \"io.kubernetes.container.restartCount\", etc... ]\r\n```\r\n\r\n### Current behavior:\r\n\r\nThe user has no control over what is a tag and what is a field; it is dictated by the input plugin.\r\n\r\n### Use case:\r\nWhen monitoring Kubernetes, the prometheus and kubernetes input plugins can create a lot of tags depending on the use case, for example if you configure your pods via deployments, the pod name will be different every time the pod gets re-deployed. Hence the need to give the administrator the ability to decide what should be a tag or field."},"comment":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/comments/384042703","html_url":"https://github.com/influxdata/telegraf/issues/3372#issuecomment-384042703","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/3372","id":384042703,"user":{"login":"krisskross","id":414023,"avatar_url":"https://avatars3.githubusercontent.com/u/414023?v=4","gravatar_id":"","url":"https://api.github.com/users/krisskross","html_url":"https://github.com/krisskross","followers_url":"https://api.github.com/users/krisskross/followers","following_url":"https://api.github.com/users/krisskross/following{/other_user}","gists_url":"https://api.github.com/users/krisskross/gists{/gist_id}","starred_url":"https://api.github.com/users/krisskross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krisskross/subscriptions","organizations_url":"https://api.github.com/users/krisskross/orgs","repos_url":"https://api.github.com/users/krisskross/repos","events_url":"https://api.github.com/users/krisskross/events{/privacy}","received_events_url":"https://api.github.com/users/krisskross/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T18:57:34Z","updated_at":"2018-04-24T18:57:34Z","author_association":"NONE","body":"This would be awesome. Almost all elasticsearch input fields would be way easier to manage as tags with Grafana and OpenTSDB."}}
{"actor":{"display_login":"krisskross"}}