This is a plugin for Logstash.
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
This output plugin takes a streaming telemetry event, ferrets out any numeric fields, and PUT|POST
s events in time series metric format (e.g prometheus, signalfx) to a configured URL over HTTP. The default format of the posted content is that accepted by the prometheus
pushgw
, but multiple types of consumers are supported (e.g. signalfx).
HTTP headers, the URL, and the HTTP operation can all be customised. All the HTTP mixin client options and the underlying Manticore client options are supported (e.g. proxy configuration, number of parallel in flight operations, client certificate, cookie support etc).
This output plugin depends on a sister input codec which handles compressed JSON streamed content over a stream based transport. The reverse is not true; i.e. the input codec plugin can be used with a variety of output plugins including this one.
Note: The streaming telemetry project is work in progress, and both the on and off box components of streaming telemetry are likely to evolve at a fast pace.
Sample configuration with logstash pipeline feeding prometheus
:
output {
telemetry_metrics {
http_method => "post"
url => "http://www.example.com:9091/metrics/jobs/xrstv2"
}
}
A slightly more involved configuration feeding content to signalfx
:
output {
telemetry_metrics {
http_method => "post"
consumer => "signalfx"
headers => {
"X-SF-TOKEN" => "AddYOURTokenHERE"
}
url => "https://ingest.signalfx.com/v2/datapoint"
content_type => "application/json"
proxy => "http://proxy.example.com:8080"
}
}
Further documentation is provided in the plugin source.
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
-
To get started, you'll need JRuby with the Bundler gem installed.
-
Create a new plugin or clone and existing from the GitHub logstash-plugins organization. We also provide example plugins.
-
Install dependencies
bundle install
Unit test development in progress.
- Edit Logstash
Gemfile
and add the local plugin path, for example:
gem "logstash-codec-output-bigmuddy-network-telemetry-metrics", :path => "/your/local/logstash-codec-output-bigmuddy-network-telemetry-metrics"
- Install plugin
bin/plugin install --no-verify
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
You can use the same 2.1 method to run your plugin in an installed Logstash by editing its Gemfile
and pointing the :path
to your local plugin development directory or you can build the gem and install it using:
- Build your plugin gem
gem build logstash-codec-output-bigmuddy-network-telemetry-metrics.gemspec
- Install the plugin from the Logstash home
bin/plugin install /your/local/plugin/logstash-codec-output-bigmuddy-network-telemetry-metrics.gem
- Start Logstash and proceed to test the plugin
Once all the necessary criteria are met, we will attempt to push this content to the logstash-plugins repository, and the corresponding gem to rubygems.org. Watch this space.