{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/1092","repository_url":"https://api.github.com/repos/influxdata/kapacitor","labels_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1092/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1092/comments","events_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1092/events","html_url":"https://github.com/influxdata/kapacitor/issues/1092","id":196224131,"number":1092,"title":"Unable to get host name from the aggregation query on the tag name.","user":{"login":"arpitkhendawat","id":14166639,"avatar_url":"https://avatars.githubusercontent.com/u/14166639?v=3","gravatar_id":"","url":"https://api.github.com/users/arpitkhendawat","html_url":"https://github.com/arpitkhendawat","followers_url":"https://api.github.com/users/arpitkhendawat/followers","following_url":"https://api.github.com/users/arpitkhendawat/following{/other_user}","gists_url":"https://api.github.com/users/arpitkhendawat/gists{/gist_id}","starred_url":"https://api.github.com/users/arpitkhendawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arpitkhendawat/subscriptions","organizations_url":"https://api.github.com/users/arpitkhendawat/orgs","repos_url":"https://api.github.com/users/arpitkhendawat/repos","events_url":"https://api.github.com/users/arpitkhendawat/events{/privacy}","received_events_url":"https://api.github.com/users/arpitkhendawat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-17T14:16:20Z","updated_at":"2016-12-19T17:05:59Z","closed_at":null,"body":"Hi Nathaniel,\r\nBelow is my code to determine the anomaly in cpu_idle measurement.\r\nI am writing the log into the measurement 'cpu_idle_anomaly'.\r\nOn doing an aggregation query on the tag name, i am not getting the host name which i need to enter in cpu_idle_anomaly.\r\n\r\n`var one_min_old = batch \r\n\t|query('SELECT mean(value), stddev(value) from sensu.\"default\".cpu_idle group by host')\r\n\t\t.offset(10s)\r\n\t\t.period(10s)\r\n\t\t.every(10s)\r\n\t\t.align()\r\n\t|shift(10s)\r\n\r\nvar new = batch \r\n\t|query('SELECT mean(value) from sensu.\"default\".cpu_idle group by host')\r\n\t\t.period(10s)\r\n\t\t.every(10s)\r\n\t\t.align()\r\n\r\none_min_old\r\n\t|join(new)\r\n\t\t.as('one_min_old','new')\r\n\t|alert()\r\n\t\t.crit(lambda: (abs(\"new.mean\" - \"one_min_old.mean\") > ( 1.0 * \"one_min_old.stddev\")))\r\n\t\t.log('/tmp/test1.log')\r\n\t|influxDBOut()\r\n\t\t.database('sensu')\r\n\t\t.retentionPolicy('default')\r\n\t\t.measurement('cpu_idle_anomaly')`\r\n\r\nCan u please help?\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/kapacitor/issues/comments/268019597","html_url":"https://github.com/influxdata/kapacitor/issues/1092#issuecomment-268019597","issue_url":"https://api.github.com/repos/influxdata/kapacitor/issues/1092","id":268019597,"user":{"login":"nathanielc","id":3771906,"avatar_url":"https://avatars.githubusercontent.com/u/3771906?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielc","html_url":"https://github.com/nathanielc","followers_url":"https://api.github.com/users/nathanielc/followers","following_url":"https://api.github.com/users/nathanielc/following{/other_user}","gists_url":"https://api.github.com/users/nathanielc/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielc/subscriptions","organizations_url":"https://api.github.com/users/nathanielc/orgs","repos_url":"https://api.github.com/users/nathanielc/repos","events_url":"https://api.github.com/users/nathanielc/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielc/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T17:05:59Z","updated_at":"2016-12-19T17:05:59Z","body":"@arpitkhendawat I think this is what you need https://docs.influxdata.com/kapacitor/v1.1/nodes/query_node/#groupby"}}
{"actor":{"display_login":"nathanielc"}}