스트림 쿼리 조회

지정한 스트림 쿼리를 조회합니다. 이 작업은 관리자 권한을 요구합니다.

HTTP 요청

GET /api/sonar/stream-queries/:guid
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
     "https://HOSTNAME/api/sonar/stream-queries/6dc1c563-d01c-3047-9573-cc6c24374925"
요청 매개변수
경로 매개변수
타입설명비고
guid문자열스트림 쿼리 GUID36자

정상 응답

{
  "stream_query": {
    "guid": "6dc1c563-d01c-3047-9573-cc6c24374925",
    "name": "example-code-1108",
    "description": "스트림 쿼리 예제",
    "source_type": "table",
    "sources": ["TABLE1"],
    "interval": 60,
    "query_string": "rename RESULT_CODE as RESULT_CODE | eval bucket = string(LOG_TIME, \"yyyyMMddHHmm\") | stats count by bucket,_host,RESULT_CODE,SVC_NAME,TO_SVC_NAME,CALLING_INTERFACE | rename SVC_NAME as group_field1 | rename TO_SVC_NAME as group_field2 | rename CALLING_INTERFACE as group_field3 | eval _time=date(bucket,\"yyyyMMddHHmm\") | fields _time,bucket,_host,group_field1,group_field2,group_field3,RESULT_CODE,count | import example-code-1108",
    "is_enabled": true,
    "is_async": false
  }
}
  • stream_query (맵): 조회된 스트림 쿼리 객체
    • guid (문자열): 스트림 쿼리 GUID
    • name (문자열): 이름
    • description (문자열): 설명
    • source_type (문자열): 소스 타입 (table, logger, stream 중 하나)
    • sources (배열): 소스 목록
    • interval (32비트 정수): 새로 고침 주기(초)
    • query_string (문자열): 쿼리문
    • is_enabled (불리언): 활성화 여부
    • is_async (불리언): 비동기 모드 여부

오류 응답

스트림 쿼리가 존재하지 않는 경우

HTTP 상태코드 200 응답

{
  "stream_query": null
}
식별자가 GUID 형식이 아닌 경우

HTTP 상태코드 400 응답

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
관리자 권한이 없는 경우

HTTP 상태코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}