Skip to content

[Aggregation to Metrics] List



GET /api/v1/aggs_to_metric/list

Overview

List aggregation to metrics rules

Query Request Parameters

Parameter Name Type Required Description
search string Search by Measurement name or metric name
Allow null: False
Allow empty string: True
scriptType string Type
Allow null: False
Optional values: ['rumToMetric', 'apmToMetric', 'logToMetric', 'securityToMetric', 'metricToMetric']
pageIndex integer Page number
Allow null: False
Example: 1
$minValue: 1
pageSize integer Number of items per page
Allow null: False
Example: 10
$minValue: 1
$maxValue: 100

Additional Parameter Notes

Request Example

curl 'https://openapi.guance.com/api/v1/aggs_to_metric/list?pageSize=100&pageIndex=1&scriptType=logToMetric' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed

Response

{
    "code": 200,
    "content": {
        "data": [
            {
                "workspaceUUID": "wksp_xxxx",
                "monitorUUID": "",
                "updator": "",
                "type": "aggs",
                "refKey": "",
                "secret": "",
                "jsonScript": {
                    "type": "logToMetric",
                    "query": {
                        "q": "L('default')::RE(`.*`):(count(`*`)) { `host`='hangzhou123' and `region`='guanzhou'  } BY `host_ip`",
                        "qtype": "dql"
                    },
                    "metricInfo": {
                        "desc": "",
                        "unit": "custom/[\"timeStamp\",\"ms\"]",
                        "every": "1m",
                        "metric": "test",
                        "metricField": "001-test"
                    }
                },
                "crontabInfo": {
                    "id": "cron-xxxx",
                    "crontab": null
                },
                "extend": {
                    "index": "default",
                    "source": "*",
                    "filters": [],
                    "groupBy": [
                        "host_ip"
                    ],
                    "fieldKey": "*",
                    "funcName": "count",
                    "filterString": "host:hangzhou123 region:guanzhou"
                },
                "createdWay": "manual",
                "isLocked": 0,
                "openPermissionSet": false,
                "permissionSet": [],
                "id": 2573,
                "uuid": "rul_xxxx",
                "status": 0,
                "creator": "acnt_xxxx",
                "createAt": 1734594428,
                "deleteAt": -1,
                "updateAt": -1,
                "creatorInfo": {
                    "uuid": "acnt_xxxx",
                    "status": 0,
                    "wsAccountStatus": 0,
                    "username": "xxxx",
                    "name": "xxxx",
                    "iconUrl": "",
                    "email": "xxxx@guance.com",
                    "mobile": "xxxx",
                    "acntWsNickname": ""
                },
                "updatorInfo": {}
            }
        ],
        "pageInfo": {
            "pageIndex": 1,
            "pageSize": 100,
            "count": 1,
            "totalCount": 1
        }
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "4874159640411139200"
} 

Feedback

Is this page helpful? ×