Skip to content

Commit b9aa634

Browse files
authored
Update JSONPath documentation to reflect changes (#397)
in version 1.3.4
1 parent 25eee80 commit b9aa634

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

website/docs/jsonpath.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ For more information on the supported syntax, refer to the [project page](https:
2323

2424
## Filters
2525

26+
:::note From version 1.3.4 filters are not supported anymore.
27+
28+
If your dashboards currently rely on JSONPath queries containing subexpressions, there are a few potential migration paths:
29+
30+
1. For simple queries that use subexpressions for indexing/slicing, it may be possible to rewrite the query without a subexpressions for instance `[(@.length-1)]` can also be represented as `[:-1]`.
31+
2. For more complex queries, we suggest switching to the [`jsonata` language](http://docs.jsonata.org/simple), which the plugin also supports. This language has similar features to JSONPath, including support for filter expressions (called “predicates” in the documentation).
32+
3. If changing your existing queries isn’t feasible, the community plugin [“Infinity”](https://grafana.com/grafana/plugins/yesoreyeram-infinity-datasource/) supports JSONPath expressions, including filters and subexpressions if used with the `backend` parser option. Please note that Infinity is community supported plugin.
33+
34+
:::
35+
2636
Filters let you query elements based on a logical expression.
2737

2838
For example, to query the titles of the books that cost more than 10:

website/docs/query-editor.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,10 @@ In the following example, the `name` property is present in both objects, but `v
4242
In the example below, you can see a couple of expressions and their results for the JSON structure in the previous example. Since JSONPath expressions are evaluated individually, Grafana can't tell which version that was missing.
4343

4444
| Expression | Result |
45-
|-------------------------|--------------------------------|
45+
| ----------------------- | ------------------------------ |
4646
| `$.services[*].name` | `["order-api", "billing-api"]` |
4747
| `$.services[*].version` | `["1"]` |
4848

49-
Depending on your use case, you can use a filter expression to only return items that contain a version:
50-
51-
```json
52-
$.services[?(@.version)].name
53-
```
54-
5549
### Path
5650

5751
![Path](../static/img/editor-path.png)

0 commit comments

Comments
 (0)