prometheus-community/json_exporter

array only json response

falkheiland opened this issue · 1 comments

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?