README.md in logstash-output-newrelic-0.9.1 vs README.md in logstash-output-newrelic-1.0.0

- old
+ new

@@ -1,99 +1,85 @@ -# Logstash Plugin +# New Relic Logstash Output Plugin -[![Build -Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-newrelic-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-newrelic-unit/) +This is a plugin for [Logstash](https://github.com/elastic/logstash) that outputs logs to New Relic. -This is a plugin for [Logstash](https://github.com/elastic/logstash). +## Installation +Install the New Relic Logstash plugin using the following command:</br> +`logstash-plugin install logstash-output-newrelic-logging` -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. +## Configuration -## Documentation +Add the following block to your logstash.conf (with your specific API Insert key), then restart Logstash. +There are other optional configuration properties, see below. -Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/). +Get your API Insert Key: +`https://insights.newrelic.com/accounts/<ACCOUNT_ID>/manage/api_keys` -- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive -- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide +Example: +```rb +output { + newrelic_internal { + api_key => "<API_INSERT_KEY>" + } +} +``` -## Need Help? -Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum. +### Required plugin configuration -## Developing +| Property | Description | +|---|---| +| api_key | your New Relic API Insert key | -### 1. Plugin Developement and Testing +### Optional plugin configuration -#### Code -- To get started, you'll need JRuby with the Bundler gem installed. +| Property | Description | Default value | +|---|---|---| +| concurrent_requests | The number of threads to make requests from | 1 | +| retries | The maximum number of times to retry a failed request, exponentially increasing delay between each retry | 5 | +| retry_seconds | The inital delay between retries, in seconds | 5 | +| max_delay | The maximum delay between retries, in seconds | 30 | +| base_uri | New Relic ingestion endpoint | https://log-api.newrelic.com/log/v1 | -- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example). +## Testing -- Install dependencies -```sh -bundle install +An easy way to test the plugin is to make sure Logstash is getting input from a log file you can write to. Something like this in your logstash.conf: ``` - -#### Test - -- Update your dependencies - -```sh -bundle install +input { + file { + path => "/path/to/your/log/file" + } +} ``` +* Restart Logstash +* Append a test log message to your log file: `echo "test message" >> /path/to/your/log/file` +* Search New Relic Logs for `"test message"` -- Run tests +## Notes -```sh -bundle exec rspec -``` +This plugin will attempt to parse any 'message' attribute as JSON -- if it is JSON, its JSON attributes will be added to the event. -### 2. Running your unpublished Plugin in Logstash - -#### 2.1 Run in a local Logstash clone - -- Edit Logstash `Gemfile` and add the local plugin path, for example: -```ruby -gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome" +For example, the events: ``` -- Install plugin -```sh -# Logstash 2.3 and higher -bin/logstash-plugin install --no-verify - -# Prior to Logstash 2.3 -bin/plugin install --no-verify - +[{ + "message": "some message", + "timestamp": 1531414060739 +}, +{ + {"message":"some_message","timestamp":"12897439", "compound" :"{\"a\":111, \"b\":222}"}, +}] ``` -- Run Logstash with your plugin -```sh -bin/logstash -e 'filter {awesome {}}' -``` -At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash. -#### 2.2 Run in an installed 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 -```sh -gem build logstash-filter-awesome.gemspec +Will be output as: ``` -- Install the plugin from the Logstash home -```sh -# Logstash 2.3 and higher -bin/logstash-plugin install --no-verify - -# Prior to Logstash 2.3 -bin/plugin install --no-verify - +[{ "message": "{\"key\": \"value1\", \"compound\": {\"sub_key\": \"value2\"}}", + "key": "value1", + "compound": { + "sub_key": "value2" + }, + "other": "other value" +}] ``` -- Start Logstash and proceed to test the plugin -## Contributing +## Development -All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin. - -Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here. - -It is more important to the community that you are able to contribute. - -For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file. +See [DEVELOPER.md](DEVELOPER.md)