fields
    • PDF

    fields

    • PDF

    Article Summary

    Overview

    You can look up Effective Log Search & Analytics log fields by project.

    Using this API, you can look up log fields that occur in a specified time period.
    The field to which ".raw" is placed is behind /api/v1/logs/search when its sorts feature is used.

    Request

    API URL

    GET
    https://elsa.apigw.ntruss.com/api/v1/fields
    

    Request header

    The request headers specified in common settings are required.

    Go to the creation guide of NAVER Cloud Platform authentication key and signature

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

    Request parameter

    Parameter nameRequirement statusTypeRestrictionsDescription
    projectKeyYesstring1-53Project key

    Example:
    "projectKey":"Pxxxxxx_test"
    projectIdYesintProject Id

    Example:
    “projectId”:8181
    fromYesintThe timestamp at which to start the search (UTC milliseconds).

    Example:
    “from”:1381190400000
    toYesintThe timestamp at which to end the search (UTC milliseconds).

    Example:
    “to”:1381190400000
    ### Request body
    ?projectKey=Pbxxxxx_elsa-test&projectId=8171&from=1381190400000&to=1381190400000
    

    Request examples

    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 = "GET"
    
        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 fields():
        baseurl = "https://elsa.apigw.ntruss.com" #{OpenAPI endpoint}
        url = "/api/v1/fields?projectKey=Pbxxxxx_elsa-test&projectId=8171&from=1381190400000&to=1381190400000"
    
        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
        headers = {
            "x-ncp-apigw-timestamp": str(timestamp),
            "x-ncp-iam-access-key": access_key,
            "x-ncp-apigw-signature-v2": str(signature)
        }
    
        response = requests.get(url=url,
                      verify=True,
                      headers=headers
                      )
    

    Response

    Response body

    {
    "data":[
    	"Platform.raw","projectKey","body.raw"
    	],
    "status":200
    }
    

    Was this article helpful?

    What's Next
    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.