tencent cloud

Feedback

Sampling Logs

Last updated: 2024-01-04 14:34:05
    After you enable layer-7 access logging or health check logging, if the log volume is large, full log reporting may result in high log costs. Tencent Cloud Load Balancer (CLB) supports log collection through sampling to reduce the amount of reported data and reduce log costs.
    Note:
    You can configure to store CLB access logs and health check logs in Tencent Cloud Log Service (CLS) to achieve log search, analysis, visualization, and alarming. CLS is separately billed. For more information about the billing of CLS, see Product Pricing.

    Prerequisites

    You have created the logset and log topics for access logs. For more information, see Configuring Access Logs.
    You have created the logset and log topics for health check logs. For more information, see Configuring Health Check Logs.

    Sampling Layer-7 Access Logs

    1. Log in to the CLB console and choose Access logs > Log list in the left sidebar.
    2. In the top-left corner of the Access logs page, select your region. Find the target log topic in the log topic list and choose More > Sample in the Operation column.
    3. In the Sample CLB logs pop-up window, turn on the sampling switch and configure the parameters as needed.
    Parameter
    Description
    Sample
    If the switch is turned on, log sampling is enabled.
    If the switch is turned off, full logs are collected.
    Default ratio
    If you configured the log sampling rule, logs that do not match the sampling rule are sampled based on the default sampling ratio. You can enter an integer from 1 to 100.
    Sampling field
    The status field is currently supported.
    Sampling rule
    Sampling rules support regular expressions. For example, if you want to sample logs whose status code is 400 or 500, you can set the sampling rule as to 400|500.
    Sampling ratio
    Sampling ratio. You can enter an integer from 1 to 100.
    Operation
    You can delete the sampling rule.
    Add
    If the existing sampling rules do not meet your needs, you can add more sampling rules. At most five sampling rules can be configured for each log topic.
    
    4. Click Submit to return to the log topic list page. If log sampling is enabled for a log topic, the word Sampling is displayed next to the topic name.
    

    Sampling Health Check Logs

    1. Log in to the CLB console and click Health Check Logs in the left sidebar.
    2. Other steps are the same as those described in the Sampling Layer-7 Access Logs section.

    References

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support