grafana-wtf icon indicating copy to clipboard operation
grafana-wtf copied to clipboard

Support jq-like filtering and transformation

Open amotl opened this issue 6 years ago • 4 comments
trafficstars

It would be cool to support something like the jq query and transformation language for querying and filtering data requested from the Grafana API, like outlined within https://github.com/grafana/simple-json-datasource/issues/111.

amotl avatar Apr 16 '19 01:04 amotl

We started collecting some ideas about this at [1] and started a discussion topic dedicated to further development of grafana-wtf [2]. Feel welcome to join us there.

[1] https://community.panodata.org/t/tools-for-processing-json/65 [2] https://community.panodata.org/t/developing-grafana-wtf/67

amotl avatar Nov 08 '19 14:11 amotl

When it comes to JSON transformations, I have been loving Jsonata. The syntax is terse and powerful although sometimes hard to remember. It is also extensible by adding custom functions.

Another option would be to use JMESPATH, which is what is used in the aws-cli to transform the responses from various commands. I am not aware of a javascript implementation.

markmelville avatar Jan 07 '20 23:01 markmelville

Dear Mark,

thanks for bringing up JSONata in this context. I recently stumbled upon it as well [1] and liked it on a first glimpse. Thanks also for suggesting JMESPath.

Feel free to come up with a respective implementation based on whatever you might like most.

With kind regards, Andreas.

[1] https://community.panodata.org/t/jsonata-json-query-and-transformation-language/64

amotl avatar Jan 08 '20 01:01 amotl

I just discovered an interesting technique to interactively override application settings when they are originally stored in a YAML file, using yq in the application, by @afbjorklund.

limactl start --set='.cpus = 2 | .memory = "2GiB"'

-- https://github.com/lima-vm/lima/pull/1359

amotl avatar Feb 28 '23 13:02 amotl