Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with partial string match #288

Closed
sickel opened this issue Jul 6, 2022 · 2 comments
Closed

Problem with partial string match #288

sickel opened this issue Jul 6, 2022 · 2 comments

Comments

@sickel
Copy link

sickel commented Jul 6, 2022

I am reading in statusjson data from nagios.

A part of it:
nagiosexample.txt

I want to do a partial match on $.data.hostlist.[*].name, so I do

$.data.hostlist[?(@.name=~/bb/)].name

I would expect to get back [aaknes-bb]. What I do get is [-1, -1]. And indeed, if I do

$.data.hostlist[?(@.name=~/bb/)]. I get

{"name":-1,"plugin_output":"OK - x.y.z.z1: rta 726.213ms, (...)
{"name":-1,"plugin_output":"OK - x.y.z.z2: rta 710.566ms, (...)

and so on, rather than filtering, I have rewritten the json.

@sickel
Copy link
Author

sickel commented Jul 6, 2022

This may be the same issue as the jsonpath part of #185

@gabor
Copy link
Contributor

gabor commented May 24, 2024

hi @sickel , filte rexpressionss are not supported in the plugin anymore, since version 1.3.5, for security reasons (see https://grafana.com/grafana/plugins/marcusolsson-json-datasource/?tab=changelog for more details).

in the https://grafana.com/docs/plugins/marcusolsson-json-datasource/latest/jsonpath/#filters section several possible workarounds are described. i hope this helps.

@gabor gabor closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

No branches or pull requests

2 participants