Hello everyone
I need to draw two lines on the same diagram, each represents a r[“_field”]. First - “bytes_rx”, second - “wan_inbound_bw”. When I just use r[“_field”] == “bytes_rx” or “wan_inbound_bw”, it only shows one of the two fields. I think this happens because each of them needs different filters, and filters which is ok for one field, returns empy values for another. So I came up with this line, which works:
|> filter(fn: (r) => ((r[“_field”] == “bytes_rx” or r[“_field”] == “bytes_tx”) and r[“interface_name”] == “wan0” and r[“traffic_type”] == “all_traffic” and r[“hostname”] == “name1”) or ( r[“_field”] == “wan_inbound_bw” and r[“_measurement”] == “deployment_info” and r[“hostname”] == “name1” and r[“interface_name”] == “wan0”))
But I want to make it more like common InfluxDB code with multiple “|> filter(fn: (r) =>” lines. Is it possible? How to write it properly?