{
  "GlobalSettings": {
    "type": "dynamic",
    "separator": "_"
  },
  "vectors": [
    {
      "URL": "$BaseURL/http/upstreams",
      "urlId": 1,
      "URLSetting": {
        "requestType": "get"
      },
      "path": [
		{
          "isPartOfHierarchy": true,
          "query": "$.backend.peers.[*].server",
          "replaceVectorKey": "serverKey"
        }
      ],
      "metrics": [
        {
          "mPath": "$.backend.peers.[*].",
          "operation": "none",
          "attribute": [
		    {
              "operation": "none",
              "name": "id",
              "index": 1,
              "type": 1
            },
			{
              "operation": "none",
              "name": "backup",
              "index": 2,
              "type": 1,
			    "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "false",
                    "updatedValue": 0,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "true",
                    "updatedValue": 1,
                    "useAsRegex": false
                  }
                ]
              }
            },
			{
              "operation": "none",
              "name": "weight",
              "index": 3,
              "type": 1
            },
			{
              "operation": "none",
              "name": "state",
              "index": 4,
              "type": 1,
			   "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "up",
                    "updatedValue": 1,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "draining",
                    "updatedValue": 2,
                    "useAsRegex": false
                  },
				  {
                    "pValue": "down",
                    "updatedValue": 3,
                    "useAsRegex": false
                  },
				  {
                    "pValue": "unavail",
                    "updatedValue": 4,
                    "useAsRegex": false
                  },
				  {
                    "pValue": "unhealthy",
                    "updatedValue": 5,
                    "useAsRegex": false
                  }
                ]
              }
            },
			{
              "operation": "none",
              "name": "active",
              "index": 5,
              "type": 1
            },
			{
              "operation": "none",
              "name": "max_conns",
              "index": 6,
              "type": 1
            },
			{
              "operation": "none",
              "name": "requests",
              "index": 7,
              "type": 1
            },
			{
              "operation": "none",
              "name": "sent",
              "index": 14,
              "type": 1
            },
            {
              "operation": "none",
              "name": "received",
              "index": 15,
              "type": 1
            },
            {
              "operation": "none",
              "name": "fails",
              "index": 16,
              "type": 1
            },
            {
              "operation": "none",
              "name": "unavail",
              "index": 17,
              "type": 1
            },
			{
              "operation": "none",
              "name": "downtime",
              "index": 22,
              "type": 1
            }
          ]
        },
        {
          "mPath": "$.backend.peers.[*].responses.",
          "operation": "none",
          "attribute": [
            {
              "operation": "none",
              "name": "total",
              "index": 13,
              "type": 1
            },
            {
              "operation": "none",
              "name": "1xx",
              "index": 8,
              "type": 1
            },
            {
              "operation": "none",
              "name": "2xx",
              "index": 9,
              "type": 1
            },
            {
              "operation": "none",
              "name": "3xx",
              "index": 10,
              "type": 1
            },
            {
              "operation": "none",
              "name": "4xx",
              "index": 11,
              "type": 1
            },
            {
              "operation": "none",
              "name": "5xx",
              "index": 12,
              "type": 1
            }
          ]
        },
        {
          "mPath": "$.backend.peers.[*].health_checks.",
          "operation": "none",
          "attribute": [
            {
              "operation": "none",
              "name": "checks",
              "index": 18,
              "type": 1
            },
            {
              "operation": "none",
              "name": "fails",
              "index": 19,
              "type": 1
            },
            {
              "operation": "none",
              "name": "unhealthy",
              "index": 20,
              "type": 1
            },
            {
              "operation": "none",
              "name": "last_passed",
              "index": 21,
              "type": 1,
			    "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "false",
                    "updatedValue": 0,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "true",
                    "updatedValue": 1,
                    "useAsRegex": false
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
