You can create a Logtail configuration file in the Log Service to collect HTTP data from specified URLs. After the Logtail configuration file is synchronized to the server on which Logtail is installed, Logtail sends requests at a regular interval to the specified URLs. Then, Logtail uploads the content of the response body as a data source to Log Service. This topic describes how to configure Logtail in the Log Service console to collect HTTP data.
Prerequisites
Implementation
Logtail initiates regular HTTP requests based on the URLs, methods, headers, and bodies specified in the Logtail configurations. After Logtail receives a response, Logtail uploads the response status code, the content of the response body, and the response time to Log Service.

Features
- Supports multiple URLs.
- Allows you to set multiple HTTP methods.
- Allows you to set the interval at which HTTP requests are initiated.
- Allows you to customize request headers.
- Supports HTTPS.
- Allows you to check whether the content of the request body matches a fixed pattern.
Scenarios
- Monitor application status by using HTTP APIs.
- NGINX
- Docker
- Elasticsearch
- HAProxy
- Other services that provide monitoring HTTP APIs
- Monitor service availability.
Logtail monitors the availability of a service by sending requests at a regular interval to the service and checking the response status code and latency.
- Retrieve data such as tweets and the number of followers at a regular interval.
Limits
- A URL must start with
http
orhttps
. - Custom certificates are not supported.
- Interactive communications are not supported.
Procedure
The following procedure shows how to collect data about the NGINX status module. Requests
are sent to the URL http://127.0.0.1/ngx_status
every 1,000 milliseconds. A regular expression is used to extract the status information
from the response body.
Result
"Index" : "7"
"connection" : "1"
"accepts" : "6079"
"handled" : "6079"
"requests" : "11596"
"reading" : "0"
"writing" : "1"
"waiting" : "0"
"_method_" : "GET"
"_address_" : "http://127.0.0.1/ngx_status"
"_response_time_ms_" : "1.320"
"_http_response_code_" : "200"
"_result_" : "success"
Field | Description |
---|---|
_address_ | The request URL. |
_method_ | The request method. |
_response_time_ms_ | The response latency. Unit: milliseconds. |
_http_response_code_ | The HTTP status code. |
_result_ | The request result. Valid values: success, invalid_body, match_regex_invalid, mismatch, and timeout. |
_response_match_ | Specifies whether the content of the response body matches the regular expression
that is specified by the ResponseStringMatch parameter. If the ResponseStringMatch parameter is not specified, the value of this field is null. If the ResponseStringMatch
parameter is specified, the value is yes or no.
|