I have a measurment that has multiple fields, in particular the fields value and source. I want to look at the values that come from a unique source only. How can I filter the records to have it show the values with the specified source. I would do something like so:
Thank you for your quick reply, but I think I have not made myself clear enough. Each record of the measurement collectd (for example) is made of the fields cpu-0, cpu-1, …, source. cpu-0 holds a float and source holds a string which describes the computer name the cpu it refers to. We have multiple computers sinking their data in the influx DB. So if I want to have a graph of the cpu of one computer I need to filter all records which have the field named source match the computer name.
If I follow your logic and I run the following command:
I should obtain all data from the measurement collectd related to computer computer_name. But it retrieves me No Results. I run this command in the web interface (script builder).
I obtain a table with all the different computer names.
What I want is for example the cpu-0 values of the source named computer_name.
My mistake was maybe to organize the data like above described. I should maybe have defined a field per computer source? In this case I agree that your solution is the way to go…
Should computer name be a tag or field? I’ve not really used influxDB2 so could be completely off, but if computer_name is a field i don’t think you can group by it. If its a tag, you could group by the tag then and use it to filter the machines you want to look at.
I would have thought cpu-01 would be a tag too for each CPU instance so you could filter the total CPU usage for the machine or each individual core/instance
I’m still the days of Influx 1.5.2 though so it might have changed.