Log service

更新时间:
复制 MD 格式

The CAPTCHA log service collects and stores logs from CAPTCHA interactions. Built on Alibaba Cloud Simple Log Service (SLS), the service provides query analysis, statistical charts, and an alerting service for security analysis of your authentication requests.

Billing

Fees for the log service are billed by Simple Log Service (SLS). These fees are separate from your CAPTCHA bill.

Important

CAPTCHA itself does not charge for the log service. All log fees are billed by SLS based on its standard pricing.

Enable the log service

  1. Log on to the CAPTCHA 2.0 console and go to the log service page.

  2. Select the region where your CAPTCHA requests are located: Chinese Mainland or Outside Chinese Mainland.

    Note

    Logs are stored in a default location within the selected region and are not transferred across regions. The default storage locations are:

    • Chinese Mainland: China (Shanghai)

    • Outside Chinese Mainland: Singapore

  3. Activate SLS.

    If SLS is not yet activated for your account, click Activate.

  4. Authorize access to cloud resources.

    Before enabling the log service, click Authorize and follow the prompts.

  5. Click Enable Log Service. It takes 1 to 2 minutes to create the logstore and build the index.

Disable the log service

Disabling the log service stops data ingestion but does not delete existing data in the corresponding logstore. To delete the log data, you must go to the SLS console.

  1. Log on to the CAPTCHA 2.0 console, go to the log service page, and select the region where your CAPTCHA requests are located.

  2. In the upper-right corner, click Disable Log Service. In the dialog box that appears, click OK.

  3. After disabling the service, the log service page shows that the service is not enabled. To re-enable the service, see Enable the log service.

Log fields

Initialization request log fields

Field

Description

Example

certifyId

A unique identifier for a single verification cycle.

1a0c65617575819193924043e****

mainCaptchaType

The challenge type for the initial verification.

The following values are available:

  • 02: Invisible

  • 03: Slider

  • 05: Jigsaw

  • 06: Image Restore

  • 07: One-click

03

captchaType

The challenge type for a secondary challenge. If the verification mode is not Invisible, this value is the same as the mainCaptchaType value.

The following values are available:

  • 02: Invisible

  • 03: Slider

  • 05: Jigsaw

  • 06: Image Restore

  • 07: One-click

03

initTime

The timestamp of the initialization request.

1757581931913

requestId

The unique identifier for a single request.

3151C480-678B-407A-87D5-36A1E6C3****

sceneId

A unique identifier generated when you create and save a scene in the console. This ID distinguishes between business scenarios.

19x5****

clientIp

Client IP address.

183.7..

userAgent

A string containing client information, such as browser type, version, and operating system.

Mozilla/5.0 (Linux; Android 5.0; Generic Android Build/LRXX) AppleWebKit/537.x (KHTML, like Gecko) Chrome/92.x.x.x Mobile Safari/537.x

Authentication request log fields

Field

Description

Example

certifyId

A unique identifier for a single verification cycle.

1a0c65617575819193924043e****

mainCaptchaType

The challenge type for the initial verification.

Valid values:

  • 02: Invisible

  • 03: Slider

  • 05: Jigsaw

  • 06: Image Restore

  • 07: One-click

  • Fake: The verification API was called directly without an initialization request, and no CAPTCHA challenge was rendered.

03

captchaType

The challenge type for a secondary challenge. If the verification mode is not Invisible, this value is the same as the mainCaptchaType value.

Valid values:

  • 02: Invisible

  • 03: Slider

  • 05: Jigsaw

  • 06: Image Restore

  • 07: One-click

  • Fake: The verification API was called directly without an initialization request, and no CAPTCHA challenge was rendered.

03

requestId

The unique identifier for a single request.

3151C480-658B-407A-87D5-36A1E6C3****

sceneId

A unique identifier generated when you create and save a scene in the console. This ID distinguishes between business scenarios.

1935****

verifyTime

The timestamp of the authentication request.

1757581931913

verifyResult

The verification result.

  • true: The verification passed.

  • false: The verification failed.

true

verifyCode

A code that provides details about the verification outcome.

For more information, see Client V3 architecture response data.

T001

clientIp

Client IP address.

183.7..

userAgent

A string containing client information, such as browser type, version, and operating system.

Mozilla/5.0 (Linux; Android 5.0; Generic Android Build/LRXX) AppleWebKit/537.x (KHTML, like Gecko) Chrome/92.x.x.x Mobile Safari/537.x

url

The URL of the business page where the CAPTCHA is located.

https://example.com/

umid

A unique identifier used to calculate device-level metrics.

625796e86dsdd1dd56203062c2690a****

Log query examples

The following examples show common queries for the CAPTCHA log service. Use these queries to quickly troubleshoot issues and gain business insights.

  • Use certifyId to query information about a specific verification.

    certifyId: xxxxxx | select from_unixtime(verifyTime / 1000) as time, clientIp, verifyResult, verifyCode
  • Use requestId to query information about a specific verification.

    requestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx | select from_unixtime(verifyTime / 1000) as time, clientIp, verifyResult, verifyCode
  • Query the distribution of page URLs from which clients initiate verification requests.

    sceneId: xxxxxx | select url, count(1) as t group by url order by t desc
  • Query the distribution of verification results for a specific scene.

    sceneId: xxxxxx | select verifyResult, count(1) as t group by verifyResult order by t desc
  • Query the distribution of status codes for failed verifications in a specific scene.

    sceneId: xxxxxx and verifyResult: false | select verifyCode, count(1) as t group by verifyCode order by t desc
  • Query the top client IP addresses and their locations by verification count.

    sceneId: xxxxxx | select clientIp, ip_to_country(clientIp) as country, ip_to_province(clientIp) as province, count(1) as t group by clientIp, country, province order by t desc
  • Query the top umid values by verification count.

    sceneId: xxxxxx | select umid, count(1) as t group by umid order by t desc