Skip to content

Logstash

Collect log information via Logstash.

Installation and Deployment

Enable the logstreaming collector in DataKit

  • Enable the logstreaming collector

Navigate to the conf.d/log directory under the DataKit installation directory, copy logstreaming.conf.sample and rename it to logstreaming.conf.

[inputs.logstreaming]
  ignore_url_tags = true

For a detailed introduction to the logstreaming collector, refer to the official documentation

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 the measurement of the line protocol. For example, nginx or redis (/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.

Feedback

Is this page helpful? ×