MENU
      download

        download


        기사 요약

        개요

        Effective Log Search & Analytics의 프로젝트 별 로그를 다로운드할 수 있습니다.

        요청

        API URL

        POST
        https://elsa.apigw.ntruss.com/api/v1/logs/download
        HTTP

        요청 헤더

        공통설정에 명시된 요청헤더가 필요합니다.

        NAVER Cloud Platform 인증키 및 Signature 생성 가이드 바로가기

        x-ncp-apigw-timestamp: {current timestamp}
        x-ncp-iam-access-key: {your iam access key}
        x-ncp-apigw-signature-v2: {generated signature}
        Plain text

        요청 파라미터

        파라미터명필수여부타입제약사항설명
        projectKeyYesstring1-53프로젝트 키

        예시:
        "projectKey":"Pxxxxxx_test"
        projectIdYesintProject Id

        예시:
        “projectId”:8181
        fromYesint검색을 시작할 타임스탬프(UTC milliseconds).

        예시:
        “from”:1381190400000
        toYesint검색을 종료할 타임스탬프(UTC milliseconds).

        예시:
        “to”:1381190400000
        formatNostringCSV or JSON기본값: JSON
        다로운드할 파일 형식.

        예시:
        “format”: “CSV”
        limitNoint1 - 1000기본값: 100
        요청에 대한 반환할 로그 수입니다.

        예시:“limit”: 1000
        countNoint1 - 200000기본값: 100000
        총 다운로드 로그 수입니다.

        예시:
        “count”: 200000
        includeFieldsNo[string]기본값: 모든 필드
        로그를 다로운드할 때 필요한 필드 이름의 리스트입니다.

        예시:
        “includeFields”: [“logSource”,” logType”,”body”]

        요청 바디

        {
          "projectKey": "Pbxxxxx_elsa-test",
          "projectId": 16706,
          "from": 1381190400000,
          "to": 1381190400000,
          "format": "JSON",
          "includeFields": ["logSource","logType","ExceptionType"],
          "limit": 100,
          "count": 50000
        }
        JSON

        요청 예시

        import hashlib
        import hmac
        import base64
        import time
        import requests
        
        def make_signature(access_key, secret_key, timestamp, url):
            timestamp = str(timestamp)
            secret_key = bytes(secret_key, 'UTF-8')
            method = "POST"
        
            message = method + " " + url + "\n" + timestamp + "\n" + access_key
            message = bytes(message, 'UTF-8')
            signingKey = base64.b64encode(hmac.new(secret_key, message, digestmod=hashlib.sha256).digest())
            return signingKey.decode('UTF-8')
        
        
        def log_download():
            baseurl = "https://elsa.apigw.ntruss.com" #{OpenAPI endpoint}
            url = "/api/v1​/logs​/download"
        
            access_key = "accessKey" #{Main / Sub Account Access Key}
            secret_key = "secretKey" #{Main / Sub Account Secret Key}
            timestamp = int(time.time() * 1000)
        
            signature = make_signature(access_key, secret_key, timestamp, url)
            url = baseurl + url
        
            payload = 	{
        	  "projectKey": "Pbxxxxx_elsa-test",
        	  "projectId": 8171,
        	  "format": "JSON",
        	  "from": 1381190400000,
        	  "to": 1381190400000,
        	  "includeFields": ["logSource","logType","ExceptionType"],
        	  "limit": 100,
        	  "count": 50000
        	}
        
        
            headers = {
                "x-ncp-apigw-timestamp": str(timestamp),
                "x-ncp-iam-access-key": access_key,
                "x-ncp-apigw-signature-v2": str(signature)
            }
        
            response = requests.post(url=url,
                          json=payload,
                          verify=True,
                          headers=headers
                          )
        Python

        응답

        응답 바디

        application/zip
        JSON

        이 문서가 도움이 되었습니까?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.