{"version": "2.0","statement": [{"effect": "allow","action": ["cls:SearchLog"],"resource": ["*"]}]}
GET /${topic_id}/_searchPOST /${topic_id}/_search
${topic_id} is the log topic ID, equivalent to the index in Elasticsearch, and can be obtained on the log topic list page.__TIMESTAMP__ field instead of the @timestamp field in Elasticsearch.__TIMESTAMP__ is the log time, which is a Unix timestamp in milliseconds, using range for filtering, representing the time range for querying logs.reqMethod is GET.curl -X POST "https://ap-chongqing.cls.tencentcs.com/elasticsearch/58b9496c-c6c6-48b3-xxx-50824857a13c/_search" \\-H "Content-Type: application/json" \\-u AKIDBFvNbcOwLWTXXXXXXXXXXXXXXXXXXXXX:bx5zf6JI3wb18XXXXXXXXXXXXXXXXXXXXX \\-d '{"track_total_hits": true,"size": 10,"query": {"bool": {"filter": [{ "match": { "reqMethod": "GET" } },{"range": {"__TIMESTAMP__": {"gte": 1774923995000,"lte": 1774924895000}}}]}}}'
USER in the full log text, and perform grouped statistics by resHttpCode.curl -X POST "https://ap-chongqing.cls.tencentcs.com/elasticsearch/58b9496c-c6c6-48b3-xxxx-50824857a13c/_search" \\-H "Content-Type: application/json" \\-u AKIDBFvNbcOwLWTXXXXXXXXXXXXXXXXXXXXX:bx5zf6JI3wb18XXXXXXXXXXXXXXXXXXXXX \\-d '{"query": {"bool": {"filter": [{"multi_match": {"type": "best_fields","query": "USER","lenient": true}},{"range": {"__TIMESTAMP__": {"gte": 1774923995000,"lte": 1774924895000}}}]}},"aggs": {"http_code_distribution": {"terms": {"field": "resHttpCode","size": 100,"min_doc_count": 1}}}}'
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback