{
  "GlobalSettings": {
    "type": "dynamic",
    "separator": "_",
    "commonReplaceChars": "/",
    "commonURLHeaders": [
      ""
    ]
  },
  "vectors": [
    {
      "URL": "$BaseURL/v3/apps",
      "urlId": 1,
      "replaceParams": [
        {
          "param": "guid",
          "path": "$.resources[?(@.state == 'STARTED')].guid"
        },
        {
          "param": "appName",
          "path": "$.resources[?(@.state == 'STARTED')].name",
          "mappedPeer": "guid"
        }
      ],
      "URLSetting": {
        "requestType": "get"
      }
    },
    {
      "URL": "$BaseURL/v3/processes/guid#1/stats?addApp=appName#1",
      "urlId": 2,
      "depURLIds": [
        1
      ],
      "path": [
        {
          "isPartOfHierarchy": true,
          "defName": "appName#1"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.resources[?(@.state == 'RUNNING')].host",
          "replaceVectorKey": "hostIP"
        },
        {
          "isPartOfHierarchy": true,
          "defName": "Instance"
        },
        {
          "isPartOfHierarchy": false,
          "query": "$.resources[?(@.state == 'RUNNING' && @.host == 'hostIP')].index",
          "replaceVectorKey": "indexVal"
        }
      ],
      "URLSetting": {
        "requestType": "get"
      },
      "metrics": [
        {
          "mPath": "$.resources[?(@.state == 'RUNNING' && @.host == 'hostIP' && @.index=='indexVal')].usage.",
          "attribute": [
            {
              "operation": "none",
              "name": "cpu",
              "index": 1,
              "type": 1
            },
            {
              "operation": "none",
              "name": "mem",
              "index": 2,
              "type": 1
            },
            {
              "operation": "none",
              "name": "disk",
              "index": 3,
              "type": 1
            }
          ]
        },
        {
          "mPath": "$.resources[?(@.state == 'RUNNING' && @.host == 'hostIP' && @.index=='indexVal')].",
          "attribute": [
            {
              "operation": "none",
              "name": "mem_quota",
              "index": 4,
              "type": 1
            },
            {
              "operation": "none",
              "name": "disk_quota",
              "index": 5,
              "type": 1
            }
          ]
        },
        {
          "mPath": "$.resources[?(@.state == 'RUNNING' && @.host == 'hostIP' && @.index=='indexVal')].",
          "attribute": [
            {
              "operation": "none",
              "name": "state",
              "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "DOWN",
                    "updatedValue": 0,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "STARTING",
                    "updatedValue": 1,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "RUNNING",
                    "updatedValue": 2,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "CRASHED",
                    "updatedValue": 3,
                    "useAsRegex": false
                  }
                ]
              },
              "index": 6,
              "type": 1
            }
          ]
        },
        {
          "mPath": "$.resources[?(@.state == 'RUNNING' && @.host == 'hostIP' && @.index=='indexVal')].",
          "attribute": [
            {
              "operation": "none",
              "name": "uptime",
              "index": 7,
              "type": 1
            }
          ]
        }
      ]
    }
  ]
}
