미복구 이벤트 목록 조회¶
POST /api/v1/events/abnormal/list
개요¶
지정된 시간 범위 내의 미복구 이벤트(동일한 df_monitor_checker_event_ref의 최근 이벤트 상태가 ok가 아닌 경우) 목록을 조회합니다. 일반적으로 최근 6시간 데이터를 조회합니다.
Body 요청 파라미터¶
| 파라미터명 | 유형 | 필수 | 설명 |
|---|---|---|---|
| search | string | 이벤트 제목 검색 비어 있음 허용: False |
|
| lastStatus | string | 마지막 상태 비어 있음 허용: False 예시: critical 선택 가능한 값: ['fatal', 'critical', 'error', 'warning', 'nodata'] |
|
| timeRange | array | Y | 시간 범위, 기본값은 최근 6시간, 시간 차이는 6시간을 초과할 수 없음 비어 있음 허용: False $minLength: 2 최대 길이: 2 예시: [1642563283250, 1642563304850] |
| timeRange[*] | integer | Y | 밀리초 단위 정수 타임스탬프 비어 있음 허용: False |
| filters | array | 필터 조건 목록 비어 있음 허용: False |
|
| offset | integer | 오프셋 비어 있음 허용: False 예시: 10 $minValue: 0 |
|
| limit | integer | 페이지당 반환 개수 비어 있음 허용: False 예시: 10 $minValue: 1 $maxValue: 100 |
파라미터 추가 설명¶
파라미터 설명:
템플릿의 기본 구조는 다음으로 구성됩니다: 뷰 구조(차트 구조, 뷰 변수 구조, 차트 그룹 구조 포함)
filters의 주요 구조 설명
| 파라미터명 | type | 필수 | 설명 |
|---|---|---|---|
| condition | string | 이전 필터 조건과의 관계, 선택 가능한 값: and, or; 기본값: and |
|
| filters | array | 하위 필터 조건, 괄호로 한 번 더 묶는 것과 같습니다. 이 파라미터가 존재하면 condition만 적용되고 다른 파라미터는 무시됩니다. |
|
| name | string | 필터링할 필드명 | |
| operation | string | 연산자, 선택 가능한 값: >, >=, <, <=, =, !=, in, wildcard, query_string, exists |
|
| value | array | 값 목록 | |
| value[#] | string/int/boolean | 문자열/숫자/불리언 유형 가능, 데이터 비교 시 operation의 특성에 따라 value에서 특정 요소를 가져와 비교합니다. 예를 들어 operation이 =인 경우 value[0]만 연산에 사용됩니다. |
filters 예시
[
{
"name": "A",
"condition": "and",
"operation": "between",
"value": [1577410594000, 1577410494000]
},
{
"condition": "and",
"filters": [
{
"name": "tagA",
"condition": "and",
"operation": ">",
"value": 12,
},
{
"name": "tagB",
"condition": "and",
"operation": "=",
"value": ["fff"]
}
],
},
{
"name": "tagC",
"condition": "and",
"operation": "=",
"value": ["ok"]
}
]
요청 예시¶
curl 'https://openapi.guance.com/api/v1/events/abnormal/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"offset": 0, "limit": 10, "timeRange": [1642563283250, 1642563304850]}' \
--compressed
응답¶
{
"code": 200,
"content": {
"data": [
{
"__docid": "E_c7jodqs24loo3v53qc50",
"alert_time_ranges": [
[
1642541760000,
null
]
],
"date": 1642563300000,
"df_dimension_tags": "{\"host\":\"10-23-190-37\"}",
"df_event_id": "event-6ea0350eda12405dad9c1cba4b28cdc3",
"df_message": "critical\ncpu\n0.010000123409284342",
"df_meta": "{\"alerts_sent\":[],\"check_targets\":[{\"alias\":\"Result\",\"dql\":\"M::`cpu`:(NON_NEGATIVE_DERIVATIVE(`usage_user`) AS `DingTalk`) { `host` = '10-23-190-37' } BY `host`\",\"range\":3600}],\"checker_opt\":{\"id\":\"rul_xxxx32\",\"interval\":60,\"message\":\"{{ df_status }}\\n{{ df_monitor_checker_name }}\\n{{ Result }}\",\"name\":\"cpu\",\"noDataInterval\":0,\"recoverInterval\":0,\"rules\":[{\"conditionLogic\":\"and\",\"conditions\":[{\"alias\":\"Result\",\"operands\":[\"0.01\"],\"operator\":\">=\"}],\"status\":\"critical\"}],\"title\":\"title1\"},\"dimension_tags\":{\"host\":\"10-23-190-37\"},\"extra_data\":{\"type\":\"simpleCheck\"},\"monitor_opt\":{\"id\":\"monitor_xxxx32\",\"name\":\"Default Group\",\"type\":\"default\"}}",
"df_monitor_checker_event_ref": "320fed7a6dd82a0bcb2a539248e6bedc",
"df_status": "critical",
"df_title": "title1"
},
{
"__docid": "E_c7jodqs24loo3v53qc4g",
"alert_time_ranges": [
[
1642541760000,
null
]
],
"date": 1642563300000,
"df_dimension_tags": "{\"host\":\"10-23-190-37\"}",
"df_event_id": "event-d2366597f7244ae099d3fbda07d8ec5f",
"df_message": "critical\ncpu\n0.010000123409284342",
"df_meta": "{\"alerts_sent\":[],\"check_targets\":[{\"alias\":\"Result\",\"dql\":\"M::`cpu`:(NON_NEGATIVE_DERIVATIVE(`usage_user`) AS `DingTalk`) { `host` = '10-23-190-37' } BY `host`\",\"range\":3600}],\"checker_opt\":{\"id\":\"rul_xxxx32\",\"interval\":60,\"message\":\"{{ df_status }}\\n{{ df_monitor_checker_name }}\\n{{ Result }}\",\"name\":\"cpu\",\"noDataInterval\":0,\"recoverInterval\":0,\"rules\":[{\"conditionLogic\":\"and\",\"conditions\":[{\"alias\":\"Result\",\"operands\":[\"0.01\"],\"operator\":\">=\"}],\"status\":\"critical\"}],\"title\":\"title1\"},\"dimension_tags\":{\"host\":\"10-23-190-37\"},\"extra_data\":{\"type\":\"simpleCheck\"},\"monitor_opt\":{\"id\":\"monitor_xxxx32\",\"name\":\"Default Group\",\"type\":\"default\"}}",
"df_monitor_checker_event_ref": "899faaa6f042871f32fc58fe53b16e46",
"df_status": "critical",
"df_title": "title1"
}
],
"limit": 20,
"offset": 0,
"total_count": 2
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-4D5773BE-88B1-4167-A2F4-603A58404184"
}