How Do I Enable Structured Log Query?

Scenario

To check the status of asynchronous invocation requests, view the records by choosing Configuration > Configure Async Notification on the function details page, as shown in Figure 1.

**Figure 1** Asynchronous invocation records

Figure 1 Asynchronous invocation records

Prerequisites

You have enabled asynchronous invocation status persistence.

Procedure

  1. Contact customer service to add your account to the whitelist of this feature.

  2. On the Configure Async Notification page, click Enable LTS.

  3. Click Edit next to Asynchronous Notification Policy, and enable Asynchronous Invocation Status Persistence, as shown in Figure 2 and Figure 3.

    **Figure 2** Configuring asynchronous notification policy

    Figure 2 Configuring asynchronous notification policy

    **Figure 3** Enabling asynchronous invocation status persistence

    Figure 3 Enabling asynchronous invocation status persistence

  4. Configure structured query on the LTS console.

    1. On the function details page, view the log group and log stream. Press F12, choose Network, enter filter async-status-log-detail, and obtain the log group ID and log stream ID, as shown in Figure 4.

      **Figure 4** Obtaining log group ID and log stream ID

      Figure 4 Obtaining log group ID and log stream ID

    2. On the LTS console, locate the log group and log stream by their IDs.

    3. On the log stream details page, click the gear icon in the upper right.

    4. Configure log structuring.

    5. Click Intelligent Extraction.

    6. Click image1 to modify the field definition as follows:

      1. Change field1 to function_urn and its type to string.

      2. Change field2 to request_id and its type to string.

      3. Change field3 to seq_status and its type to long.

      4. Change field4 to operation_timestamp and its type to long.

      5. Change field5 to error_code and its type to long.

      6. Change field6 to error_message and its type to string.

      Enable Quick Analysis.

    7. Click Save.