tencent cloud

All product documents
Cloud Log Service
Log Filtering
Last updated: 2024-12-18 16:37:22
Log Filtering
Last updated: 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"
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

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
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon