{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/687","repository_url":"https://api.github.com/repos/influxdata/telegraf","labels_url":"https://api.github.com/repos/influxdata/telegraf/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/687/comments","events_url":"https://api.github.com/repos/influxdata/telegraf/issues/687/events","html_url":"https://github.com/influxdata/telegraf/issues/687","id":133070105,"number":687,"title":"simple continuous query for telegraf","user":{"login":"steverweber","id":1800619,"avatar_url":"https://avatars.githubusercontent.com/u/1800619?v=3","gravatar_id":"","url":"https://api.github.com/users/steverweber","html_url":"https://github.com/steverweber","followers_url":"https://api.github.com/users/steverweber/followers","following_url":"https://api.github.com/users/steverweber/following{/other_user}","gists_url":"https://api.github.com/users/steverweber/gists{/gist_id}","starred_url":"https://api.github.com/users/steverweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steverweber/subscriptions","organizations_url":"https://api.github.com/users/steverweber/orgs","repos_url":"https://api.github.com/users/steverweber/repos","events_url":"https://api.github.com/users/steverweber/events{/privacy}","received_events_url":"https://api.github.com/users/steverweber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-11T19:44:03Z","updated_at":"2016-02-11T20:00:06Z","closed_at":null,"body":"when the only value was \"value\", it seems there was a simple way to create a dynamic CQ.\r\n\r\nI'm wondering if there is a better way to do this so all sub measurements are included.\r\n```\r\nCREATE DATABASE telegraf WITH DURATION 100d\r\nCREATE RETENTION POLICY \"7y\" ON telegraf DURATION 2555d REPLICATION 1\r\n\r\nCREATE CONTINUOUS QUERY \"30m_cpu\" ON telegraf BEGIN SELECT mean(usage_idle) as usage_idle INTO telegraf.\"7y\".:measurement FROM telegraf.\"default\".cpu GROUP BY time(30m) END\r\n\r\nCREATE CONTINUOUS QUERY \"30m_mem\" ON telegraf BEGIN SELECT mean(used_percent) as used_percent INTO telegraf.\"7y\".:measurement FROM telegraf.\"default\".mem GROUP BY time(30m) END\r\n\r\nCREATE CONTINUOUS QUERY \"30m_disk\" ON telegraf BEGIN SELECT mean(used_percent) as used_percent INTO telegraf.\"7y\".:measurement FROM telegraf.\"default\".disk GROUP BY time(30m) END\r\n```"},"comment":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/comments/183039622","html_url":"https://github.com/influxdata/telegraf/issues/687#issuecomment-183039622","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/687","id":183039622,"user":{"login":"steverweber","id":1800619,"avatar_url":"https://avatars.githubusercontent.com/u/1800619?v=3","gravatar_id":"","url":"https://api.github.com/users/steverweber","html_url":"https://github.com/steverweber","followers_url":"https://api.github.com/users/steverweber/followers","following_url":"https://api.github.com/users/steverweber/following{/other_user}","gists_url":"https://api.github.com/users/steverweber/gists{/gist_id}","starred_url":"https://api.github.com/users/steverweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steverweber/subscriptions","organizations_url":"https://api.github.com/users/steverweber/orgs","repos_url":"https://api.github.com/users/steverweber/repos","events_url":"https://api.github.com/users/steverweber/events{/privacy}","received_events_url":"https://api.github.com/users/steverweber/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T20:00:06Z","updated_at":"2016-02-11T20:00:06Z","body":"what i did was way wrong... should have some sorta group by for the host...  \r\nperhaps...\r\n```\r\nCREATE CONTINUOUS QUERY \"30m_cpu\" ON telegraf BEGIN SELECT     distinct(host) as host, mean(usage_idle) as usage_idle INTO telegraf.\"7y\".:measurement FROM telegraf.\"default\".cpu GROUP BY time(30m), host END\r\n```"}}