Effective Log Search & Analytics Overview
    • PDF

    Effective Log Search & Analytics Overview

    • PDF

    Article summary

    Overview

    NAVER Cloud Platform is a cloud service built with NAVER's latest computing technology and operational know-how.
    Among the many product groups provided by NAVER Cloud Platform, the set of application programming interfaces (APIs) that allow you to use solution products is called NAVER Cloud Platform API.

    The Effective Log Search & Analytics API is provided in the RESTful format.

    It is done through HTTP GET/POST method calls.

    Common settings

    API URL

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

    Request header

    Header nameDescription
    x-ncp-apigw-timestampIt indicates the time elapsed since January 1, 1970 00:00:00 UTC in milliseconds.
    If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.
    x-ncp-iam-access-keyAPI key issued by NAVER Cloud Platform or access key issued by IAM
    x-ncp-apigw-signature-v2A signature that encrypts the body with the secret key mapped to the access key
    HmacSHA256 is used as the HMAC encryption algorithm

    The following is an example of creating "x-ncp-apigw-signature-v2" in Java. Please refer to the document below for details.

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

    public String makeSignature() {
        String space = " ";                    // one space
        String newLine = "\n";                    // new line
        String method = "GET";                    // method
        String url = "/api/v1/fields?projectKey=Pbxxxxx_elsa-test&projectId=8171&from=1381190400000&to=1381190400000";    // url (include query string)
        String timestamp = "{timestamp}";            // current timestamp (epoch)
        String accessKey = "{accessKey}"            // access key id (from portal or sub account)
        String secretKey = "{secretKey}";
    
        String message = new StringBuilder()
            .append(method)
            .append(space)
            .append(url)
            .append(newLine)
            .append(timestamp)
            .append(newLine)
            .append(accessKey)
            .toString();
    
        SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA256");
        Mac mac = Mac.getInstance("HmacSHA256");
        mac.init(signingKey);
    
        byte[] rawHmac = mac.doFinal(message.getBytes("UTF-8"));
        String encodeBase64String = org.apache.commons.codec.binary.Base64.encodeBase64String(rawHmac);
    
      return encodeBase64String;
    }
    

    Operation

    API nameDescription
    fieldsLooks up log fields by project
    searchLooks up logs by project
    downloadDownloads logs by project

    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.