Logstash¶
Collect log information via Logstash.
Installation and Deployment¶
Enable the logstreaming collector in DataKit¶
- Enable the
logstreamingcollector
Navigate to the conf.d/samples directory under the DataKit installation directory, copy logstreaming.conf.sample and rename it to logstreaming.conf.
For a detailed introduction to the logstreaming collector, refer to the official documentation
-
Restart DataKit
Adjust Logstash Configuration¶
DataKit uses the logstreaming collector to collect log information reported by Logstash, so Logstash needs to point the output address to the receiving address of the logstreaming collector.
....
## Send collected data to DataKit
output {
http {
http_method => "post"
format => "json"
url => "http://127.0.0.1:9529/v1/write/logstreaming?source=nginx"
}
}
url: The address is the DataKit collector address, adjust according to actual conditions.source: Identifies the data source, which is themeasurementof the line protocol. For example,nginxorredis(/v1/write/logstreaming?source=nginx)
For an introduction to the parameters of the logstreaming collector, refer to the official documentation
After making adjustments, restart Logstash to make the configuration effective.