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

array only json response #260

Open
falkheiland opened this issue Oct 10, 2023 · 1 comment
Open

array only json response #260

falkheiland opened this issue Oct 10, 2023 · 1 comment

Comments

@falkheiland
Copy link

falkheiland commented Oct 10, 2023

i got a response consisting only of an array (no object) so i can not use dot notation?.

like that

[
  "fe80:0:0:0:20c:29ff:fe2b:b16e",
  "0:0:0:0:0:0:0:1",
  "127.0.0.1",
  "192.168.1.2"
]

and want to set a value to the last value 192.168.1.2

i tried

  server:
    metrics:
    - name: ip
      type: object
      path: '{ $[3] }'
      values:
        ip: '{ * }'

and other variants, but i do not get a result. anyone got an idea how to achieve this?

@boturkin
Copy link

boturkin commented Oct 7, 2024

Try this:

...
      values:
        ip: '{ @ }'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants