Ad Widget

Collapse

How can get specific item in json path

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bab
    Senior Member
    • Aug 2020
    • 176

    #1

    How can get specific item in json path

    I am using the json path. According to the following pic it is working and returns Total_GB
    but I need it to return FREE_GB . I know I should change json path . Would you please say how I can correct it to return FREE_GB instead of TOTAL_GB ? because I resided FREE_GB instead of TOTAL_GB in the json path but it does not work


    This is my json path :
    $.[?(@.NAME=="{#NAME}")].TOTAL_GB.first()


    and this is my item returns :

    [{"NAME":"CRS","TOTAL_GB":"20","USED_GB":"1","FR EE_ GB":"19"},{"NAME":"DATA","TOTAL_GB":"13500","USE D_ GB":"9219","FREE_GB":"4281"},{"NAME":"FRA","TOTA L_ GB":"6000","USED_GB":"66","FREE_GB":"5934"},{"NA ME ":"MGMT","TOTAL_GB":"250","USED_GB":"95","FREE _GB" :"155"},{"NAME":"REDO","TOTAL_GB":"16","USED_GB ":" 0","FREE_GB":"16"}]

    Attached Files
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Works in my computer... And should work for you also.. There is no difference, what field you choose to output, TOTAL_GB or FREE_GB or USED_GB...
    If you say " it does not work"... then show us please, how exactly it does not work... whats error or something....

    Comment

    • bab
      Senior Member
      • Aug 2020
      • 176

      #3
      Originally posted by cyber
      Works in my computer... And should work for you also.. There is no difference, what field you choose to output, TOTAL_GB or FREE_GB or USED_GB...
      If you say " it does not work"... then show us please, how exactly it does not work... whats error or something....

      It was my mistake . So thanks.

      Comment

      Working...