tencent cloud

Feedback

Custom Redirect

Last updated: 2024-12-20 16:17:33

    Overview

    For the raw log entries found on the retrieval analysis page, CLS supports custom redirection by clicking the field value for further operations, such as:
    Search related logs in other log topics according to request_id.
    Query user information in the internal user management platform using user_id.
    
    
    
    Custom redirection supports two types of operations:
    Redirection type
    Applicable Scenario
    Open External URL
    Open the specified URL and carry the designated fields from the log as parameters in the URL, for example, query user information on the internal user management platform based on user_id.
    Search for other log topic
    Retrieve the specified log topic and carry the designated fields from the log as retrieval conditions, for example, retrieve related logs in other log topics based on request_id.

    Operation Steps

    Adding custom redirection

    1. Log in to the CLS console.
    2. In the left sidebar, click Search and Analysis to enter the retrieval analysis page.
    3. After querying the log, click the field value that needs redirection. In the pop-up menu, click
    
    to add a new redirection.
    
    
    
    4. Enter the following configuration information in the pop-up box:
    Jump type: Select the corresponding jump type as needed.
    Trigger field: click a field value to trigger the jump, for example, "stgw_request_id" in the above figure.
    Configuration Name: Custom name for the jump, such as "View downstream service logs".
    Other Configuration Items: Related to the jump type, see the table below for details:
    Open External URL
    Search for other log topic
    URL: The URL address that needs to be opened, starting with http:// or https://. You can use variables in the URL to dynamically obtain log field values and other information. For example, {{__currentValue__}} represents the value currently being clicked.
    Open in a new window: Whether to redirect to a new window.
    Log Topic: The log topic to be retrieved.
    Time Range: The time range to be retrieved. It is recommended to fuse the current time range or customize it.
    Continue to Use Current Search Criteria: Whether to continue to use the current search criteria.
    Add Search Criteria: Whether to add new search criteria. It can use variables to dynamically acquire log field values and other information. For example, using stgw_request_id:{{__currentValue__}} to use the currently clicked value as the key-value search criteria. When searching for other log topics, it will automatically convert to stgw_request_id:"8da469b42947445891cc10fc55d75471" appearing in the search statement.
    Open in a new window: Whether to redirect to a new window.

    Editing/Deleting Custom Redirection

    1. Log in to the CLS console.
    2. In the left sidebar, click Search and Analysis to enter the retrieval analysis page.
    3. After inquiring the logs, click to edit/delete the redirected field value. In the pop-up menu, click
    
    Manage Custom Redirection.
    
    
    
    4. In the pop-up window, click the custom redirection configuration name. Click
    
    on the right side of the name to delete the configuration, and update the configuration using the form on the right side. Finally, click Application to save.

    Variable Description

    ${__CurrentValue} indicates the currently clicked field value. When the field is word-segmented, this variable refers to the words after the word segmentation. For example, in the following figure, the separator / is behind kube-scheduler. When the mouse pointer is hovered, only kube-scheduler is highlighted. When a custom redirection is triggered by clicking, the corresponding ${__CurrentValue} is the kube-scheduler.
    
    
    
    ${__TopicId} indicates the current topic ID, such as a85bbd1c-233f-xxxx-aeda-70cbd9f8715a.
    ${__StartTime} and ${__EndTime} indicate the start and end Unix timestamps of the current query time range.
    You can use ${} to enclose the field name as a variable to represent the complete value of that field. For example, in the above image, you can use ${userAgent} to represent the value of the userAgent field, ${userAgent}=kube-scheduler/v1.20.6 (linux/amd64) kubernetes/1cb721e/leader-election.
    
    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