torkelo/grafana — pull request #331 by mavimo (2014-04-21 16:32:02+00:00)
Title: [InfluxDB] add where conditions in UI

refs #326

![screen shot 2014-04-21 at 18 19 31](https://cloud.githubusercontent.com/assets/43941/2756074/e576c122-c970-11e3-8062-59b3ee49cd62.png)

### New feature
* User can add where condition to InfluxDB query using UI
* User can define label to time series using UI

### Notes
* In comparison user must use filter string with single quote ```'``` using double quote ```"``` get error from InfluxDB, adding validation can be a plus.
* Only one condition can be add, UI have first draft to add more then one condition
* Using conditions need to set ```labels```without labels the series name using the same columns will be the same generating error on data visualization (data are duplicated).

### Screenshots
User can add filter in UI click on the icon:
![InfluxDB - Filter activation](https://cloud.githubusercontent.com/assets/43941/2756075/e57e3fd8-c970-11e3-935c-2a2b911e48da.png)
User can select operation (and / or, actually ```or``` can't be used, only ```and``` must be used, this will be used in next releases to have multiple conditions) and can choise field to filter, fields are automatically detected from data in InfluxDB:
![InfuxDB - filter key set using autocomplete](https://cloud.githubusercontent.com/assets/43941/2756077/e58ae878-c970-11e3-9fac-9b198b777513.png)
InfluxDB conditions are exposed (conditions are from "The Where Clause" available on [InfluxDB](http://influxdb.org/docs/query_language/#) docs, and are relative to InfluxDB >= 0.4.0). Condition (if string) need to be wrapped in single quote.
![InfluxDB - Filter conditions](https://cloud.githubusercontent.com/assets/43941/2756076/e584981a-c970-11e3-90e8-3c5298e841c7.png)
Result graph display data with the right filters and labels.
![InfluxDB - Filter results](https://cloud.githubusercontent.com/assets/43941/2756073/e56ff464-c970-11e3-8ddc-255d9475e553.png)