{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4031","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4031/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4031/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4031/events","html_url":"https://github.com/influxdb/influxdb/issues/4031","id":105399344,"number":4031,"title":"[feature request] perform math operations on results of different queries","user":{"login":"szop85","id":2103595,"avatar_url":"https://avatars.githubusercontent.com/u/2103595?v=3","gravatar_id":"","url":"https://api.github.com/users/szop85","html_url":"https://github.com/szop85","followers_url":"https://api.github.com/users/szop85/followers","following_url":"https://api.github.com/users/szop85/following{/other_user}","gists_url":"https://api.github.com/users/szop85/gists{/gist_id}","starred_url":"https://api.github.com/users/szop85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szop85/subscriptions","organizations_url":"https://api.github.com/users/szop85/orgs","repos_url":"https://api.github.com/users/szop85/repos","events_url":"https://api.github.com/users/szop85/events{/privacy}","received_events_url":"https://api.github.com/users/szop85/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/influxdb/influxdb/milestones/38","html_url":"https://github.com/influxdb/influxdb/milestones/Longer%20term","labels_url":"https://api.github.com/repos/influxdb/influxdb/milestones/38/labels","id":1020714,"number":38,"title":"Longer term","description":"Milestone for issues that aren't part of this release or the next","creator":{"login":"beckettsean","id":6537329,"avatar_url":"https://avatars.githubusercontent.com/u/6537329?v=3","gravatar_id":"","url":"https://api.github.com/users/beckettsean","html_url":"https://github.com/beckettsean","followers_url":"https://api.github.com/users/beckettsean/followers","following_url":"https://api.github.com/users/beckettsean/following{/other_user}","gists_url":"https://api.github.com/users/beckettsean/gists{/gist_id}","starred_url":"https://api.github.com/users/beckettsean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckettsean/subscriptions","organizations_url":"https://api.github.com/users/beckettsean/orgs","repos_url":"https://api.github.com/users/beckettsean/repos","events_url":"https://api.github.com/users/beckettsean/events{/privacy}","received_events_url":"https://api.github.com/users/beckettsean/received_events","type":"User","site_admin":false},"open_issues":130,"closed_issues":7,"state":"open","created_at":"2015-03-13T17:41:02Z","updated_at":"2015-09-08T23:12:08Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-09-08T14:53:56Z","updated_at":"2015-09-09T18:31:17Z","closed_at":null,"body":"Hey guys,\r\n\r\nwe're using a combination of InfluxDB, Grafana and collectd and running into a few troubles. Is there a way to sum two different values like:\r\n\r\n```\r\nselect count(value) from mysql_value where type='mysql_commands' AND type = 'mysql_commands' and type_instance='show_databases'\r\n\r\nname: mysql_value\r\n-----------------\r\ntime                    count\r\n1970-01-01T00:00:00Z    1124\r\n```\r\n\r\nand\r\n\r\n```\r\nselect count(value) from mysql_value where type='mysql_commands' AND type = 'mysql_commands' and type_instance='show_grants'\r\nname: mysql_value\r\n-----------------\r\ntime                    count\r\n1970-01-01T00:00:00Z    1127\r\n```\r\n?\r\n\r\nCheers,\r\nSzop"},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/138999671","html_url":"https://github.com/influxdb/influxdb/issues/4031#issuecomment-138999671","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4031","id":138999671,"user":{"login":"beckettsean","id":6537329,"avatar_url":"https://avatars.githubusercontent.com/u/6537329?v=3","gravatar_id":"","url":"https://api.github.com/users/beckettsean","html_url":"https://github.com/beckettsean","followers_url":"https://api.github.com/users/beckettsean/followers","following_url":"https://api.github.com/users/beckettsean/following{/other_user}","gists_url":"https://api.github.com/users/beckettsean/gists{/gist_id}","starred_url":"https://api.github.com/users/beckettsean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckettsean/subscriptions","organizations_url":"https://api.github.com/users/beckettsean/orgs","repos_url":"https://api.github.com/users/beckettsean/repos","events_url":"https://api.github.com/users/beckettsean/events{/privacy}","received_events_url":"https://api.github.com/users/beckettsean/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T18:31:17Z","updated_at":"2015-09-09T18:31:17Z","body":"@szop85 yes, you can restrict the return using regex on `type_instance`:\r\n\r\n`SELECT COUNT(value) FROM mysql_value WHERE type='mysql_commands' AND type_instance =~ /^show_.*/ GROUP BY type_instance`\r\n\r\nI don't know if Grafana supports math on the returned query values but another client might, or you could put a small bit of code in between Grafana and InfluxDB to do the math. "}}