tencent cloud

피드백

Log Filtering

마지막 업데이트 시간:2024-12-18 16:37:22

    Scenario description

    Xiao Wang collected the tool's logs into CLS. Now, it is necessary to filter out logs with the operation method of PUT and POST from the cmdb logs.

    Raw Log

    [
    {
    "path": "/eks/pod/running",
    "clientIP": "1.139.21.123",
    "method": "POST"
    },
    {
    "path": "/cmdb/login",
    "clientIP": "1.139.21.123",
    "method": "PUT"
    },
    {
    "path": "/cmdb/start",
    "clientIP": "1.139.21.123",
    "method": "GET"
    }
    ]

    Processing statement

    //path contains 'cmdb' characters, keep the log, filter out the rest
    log_keep(regex_match(v("path"),regex="cmdb",full=False))
    //method contains POST or PUT characters, keep the log
    log_keep(regex_match(v("method"),regex="POST|PUT",full=False))

    Processing result

    {
    "clientIP":"1.139.21.123",
    "method":"PUT",
    "path":"/cmdb/login"
    }
    
    문의하기

    고객의 업무에 전용 서비스를 제공해드립니다.

    기술 지원

    더 많은 도움이 필요하시면, 티켓을 통해 연락 바랍니다. 티켓 서비스는 연중무휴 24시간 제공됩니다.

    연중무휴 24시간 전화 지원