Commit graph

7141 commits

Author SHA1 Message Date
Pier-Hugues Pellerin
4597eac21d Add a WrappedSynchronousQueue#offer method
Expose the Java's `#offer` method of the `SynchronousQueue` class,
This method allow the input developper to correctly apply back pressure
to the network clients.

If you use `#push` it will block forever until the pipeline free some
space, this behavior is sufficient if the pipeline outputs are healthy.
But if the output stale the backpressure will be applied up to the input
(producers) when reading a file this scenario is fine since we will just
stop reading the file until the thread unblock again.

In the context of network clients, the story is a bit different the
clients will timeout and try to reconnect to restransmit their payload
creating multiple new connection thread block on the queue. In some case
this will lead into a OOM issues.

This PR is the first step to communicate that the queue is under
pressure.

Fixes #4408
2016-01-05 17:09:58 +00:00
Andrew Cholakian
84d0e42a30 Up default # of pipeline workers to 100% of cores
This is predicated on the fact that with the ng_pipeline it is expected that workers
will spend a significant amount of time in iowait due to outputs like the Elasticsearch
output. In benchmarks based on real-world Apache log files the best performance came out
of scenarios where pipeline_workers > num_cpu_cores. Setting this to default to the # of
cores is a defensive decision that should handle cases where users have particularly IO
heavy inputs.

For most users we should recommend setting the number of workers to be as high as possible
until performance decreases.

Previous benchmark information:
https://github.com/elastic/logstash/pull/4340

Fixes #4414
2016-01-05 17:01:23 +00:00
Andrew Cholakian
fc128fe7ff Edit docs for life of an event to cover the ng pipeline
Fixes #4392
2016-01-04 21:32:35 +00:00
Andrew Cholakian
e5cc9c407d Warn on potential memory issues when a large number of inflight messages are present
Fixes #4410
2016-01-04 19:14:14 +00:00
Suyog Rao
90a12e79b6 Add new CLI options for next gen pipeline
Fixes #4413
2016-01-04 19:11:01 +00:00
ReadmeCritic
28d64fc5e5 Update README URLs based on HTTP redirects
Fixes #4200
2016-01-04 18:44:20 +00:00
Ryan MacLean
f94ef18f24 Update README.md
Committing again after rebase. One small typo.

Fixes #4405
2016-01-04 18:40:49 +00:00
AQNOUCH Mohammed
235f02072f Updated copyright to 2016
Fixes #4411
2016-01-04 18:37:56 +00:00
Andrew Cholakian
84d4e5136b Add http poller to default plugins list
Fixes #4409
2016-01-03 23:07:03 +00:00
Ryan MacLean
342e903a99 Update README.md
Fixes #4402
2015-12-28 19:11:03 +00:00
Colin Surprenant
3081c53a99 fix to support legacy plugins specs monkeypatching pipelines 2015-12-21 17:09:29 -05:00
Suyog Rao
343b112a17 Cleanup docs directory
Remove old, unused markdown docs
Bring dir structure to mirror logstash-docs repo
2015-12-21 09:00:03 +05:30
Paul Echeverri
906dab7c39 Adds Maintainer's Guide section. 2015-12-21 08:40:21 +05:30
Andrew Cholakian
8de54e46ce NG Pipeline
Fixes #4363
2015-12-16 20:03:05 +00:00
Paul Echeverri
c95947d32a Fixes incorrect config example
Fixes #4359
2015-12-16 00:30:01 +00:00
Colin Surprenant
56bb12d85c using symbols in Event data does not make sense 2015-12-15 17:41:40 -05:00
Colin Surprenant
72637f5bc3 proper java to ruby conversions and specs
proper java to ruby convertion and specs

missing ruby conversions

add missing timestamp= method

added usec method

missing constants

added usec, tv_usec, year methods

clean ruby_to_hash_with_metadata method

rework boolean cast

add BigDecimal

missing import

reworked Ruby to JAva type conversion

better nil objects handling and better debug trace
2015-12-15 16:41:29 -05:00
Robert Neumayer
a43709e8fb Fix configtest in sysv init script
Replace non-existing log function with echo.
Replace "exit 1" with "return 1" to make quiet function work.

Fixes #4321
2015-12-15 02:32:19 +00:00
Vincent Bernat
f68bde191d pkg: ensure dev/beta/rc are ordered before a regular version
```ruby
class DpkgVersion
  include Comparable
  attr :version
  def <=>(anOther)
    return -1 if system("dpkg --compare-versions #{version} lt #{anOther.version}")
    return 1 if system("dpkg --compare-versions #{version} gt #{anOther.version}")
    return 0
  end
  def initialize(version)
    @version = version
  end
  def to_s
    @version
  end
end

versions="1.5.1 1.5.0 1.5.0.rc3 1.5.0.beta2 1.5.0.alpha3".split
versions=versions.map { |x| DpkgVersion.new(x.gsub(/\.([[:alpha:]])/, '~\1')) }
versions=versions.sort
puts versions
```

This outputs:

```
1.5.0~alpha3
1.5.0~beta2
1.5.0~rc3
1.5.0
1.5.1
```

Fixes #2461
2015-12-11 20:17:33 +00:00
Colin Surprenant
a30b5a6943 fix missing methods in Java Timestamp
add utc and gmtime, force UTC in setTime

add missing specs for utc and gmtime

add missing to_f

add missing specs for to_f and to_i
2015-12-10 17:29:05 -05:00
Colin Surprenant
2c61e310e3 fix nil value field reference assignment in Java Event
fix fieldref nil value assignment

add fieldref nil value assignment spec

better spec description and better expectation
2015-12-10 17:08:39 -05:00
Colin Surprenant
48587abe5c use sprintf un toString
Fixes #4325
2015-12-10 16:48:35 -05:00
Colin Surprenant
0882b3060d cleanup logger reset in after(:each) 2015-12-10 16:44:32 -05:00
Colin Surprenant
b855d7b300 explicit imports 2015-12-10 16:44:24 -05:00
Colin Surprenant
c5a70b4572 expose DEFAULT_LOGGER and remove nil/null support 2015-12-10 16:44:17 -05:00
Colin Surprenant
0fdb68c002 DRY and added comments 2015-12-10 16:44:02 -05:00
Colin Surprenant
d00c005581 add comments 2015-12-10 16:43:54 -05:00
Colin Surprenant
e013014c40 typo 2015-12-10 16:43:47 -05:00
Colin Surprenant
27d3c2b25a support injectable Ruby logger in Java event and related specs 2015-12-10 16:43:38 -05:00
Colin Surprenant
94d5049388 replace LOGGER constant with injectable logger object 2015-12-10 16:43:24 -05:00
Colin Surprenant
9bd488f387 support clear_cache and cache_size methods in StringInterpolation, adjust specs
Fixes #4325
2015-12-10 16:43:17 -05:00
Aaron Mildenstein
e4ab2865ef Allow Logstash to be launched from a symlink
These changes allow Logstash to be launched from a symlink _only_ when the `readlink`, or suitable version of `stat` binaries are present. An error message will result if Logstash is launched from a symlink and the path cannot be discovered by one of these two methods.  The message will advise the user to use the full path instead of a symlink to launch Logstash.

fixes #4291
2015-12-04 15:27:29 -08:00
Joao Duarte
ca9335a2a7 allow logstash to run in a dir with spaces
because HeapDumpPath is set, if it contains spaces the jruby_opts
function will create two strings appended by -J
even if the list of jruby opts is constructed using replacement
shell script will not escape the path correct to the heap dump path
option needs to be added as late as possible

this is a *nix fix only, windows is not affected

Fixes #4303
2015-12-04 21:28:19 +00:00
Alvin Chen
c2adc5c57d update filebeat link
Fixes #4296
2015-12-02 18:54:16 +00:00
Alvin Chen
88e864bd48 update filebeat link
Fixes #4296
2015-12-02 18:54:15 +00:00
Joao Duarte
c3c15aa81f move misplaced shutdown_controller after broken merge
Fixes #4268
2015-12-02 18:18:44 +00:00
Colin Surprenant
6a4963a214 cleanup Event class
Fixes #4261
2015-11-30 22:51:51 +00:00
Joao Duarte
21dfae1652 fix shutdown controller when using no filters 2015-11-27 10:48:19 +00:00
Pere Urbon-Bayes
97e72b6279 update jruby to last 1.7.23 release
Fixes #4260
2015-11-25 10:04:04 +00:00
Pere Urbon-Bayes
54b9671f95 update the README to show the last versions master, 2.x and 2.1
Fixes #4217
2015-11-24 12:19:55 +00:00
Paul Echeverri
6b9e19021c Adds information on shutdown stalls, release notes, other housekeeping 2015-11-24 11:26:25 +00:00
Suyog Rao
f874bb4ba9 Added changelog for v2.1.0 2015-11-23 16:32:06 +00:00
Joao Duarte
79b90b19d7 add shutdown controller to force exit on stalled shutdown
* start logstash with --allow-unsafe-shutdown to force_exit on stalled shutdown
* by default --allow-unsafe-shutdown is disabled
* stall detection kicks in when SIGTERM/SIGINT is received
* check if inflight event count isn't going down and if there are blocked/blocking plugin threads
2015-11-19 15:35:47 +00:00
Colin Surprenant
64ae981306 clean cache to empty previous entries 2015-11-18 14:56:41 -05:00
Pier-Hugues Pellerin
21c8d4eb30 Test for Event#to_s format
Fixes #4222
2015-11-18 07:44:13 -08:00
Pier-Hugues Pellerin
c89e4abc99 Fix a string interpolation memory leak
When the event was serialized to string using a `to_s` call, mostly
happenning when doing logging. Each calls would generate a new template
each template was unique because it was containing the date.

The accumulation of templates was making logstash goes OOM.

We aren't cleaning the templates because they should stabilize to a
finite number.
2015-11-18 07:44:08 -08:00
Pere Urbon-Bayes
577d8377b8 This adds a feature to let users dump all their installed plugins,
including dependencies, and reuse them in an offline installation by
providing an package for it. It adds two important commands to the
plugin manager, the pack and upack, to handle package creation and
installation and adds the --local flag to install and update to pull
plugins from the installed local packages.

Former commits:

add a task to create a bundle, under vendor/cache of the installed gems + their dependencies, this can be used later on to be installed offline

add an option to pass the --local flag to the bin/plugin update task, so it fetch plugins from a local cache, by default under vendor/cache

rename package:build to package:build-cache as is more meaningfull

add a --local flag to bin/plugin install to users can install plugins from the local cache, under the default directory of vendor/cache

add a plugin manager command to build the local cache of installed plugins using bundler package alike command

It adds code for compressing and extracting in zip and tar formats to
the utils module of logstash. The zip module is only jruby dependant as
it uses functions provided by java.
There is also code add in the plugin manager package command to handle
compression of plugins dumping.

Cleanup the custom java code to compress and extract zip files as it has
been known that using rubyzip is good and it has a more ruby like
features so the code is more clean and portable.

set of smallish improvement requested during review

added several options to handle situation when the package of plugins we want to generate is already there

clean up old code

applyed feedback from review, mostly changed in documentating behaviour plus better wording for messages

relocate the Environment.windows? check to the bootstrap side as it's used also in the plugin manager

add an unpack bin/plugin command so users can install packages of plugins throw the plugin manager

document override behaviour in the compress helpers (for zip and tar) plus add a fix for the tar extract when reading entries

made the unpack filename parameter a required one

add a force option to the bin/plugin unpack command

add a notice to that if using a local cache the --local flag should be passed with

Code cleanup and refactor introduced during review

add two wording suggestions comming from review

ammend more wording

skip the major version validation as in situation where there is no internet connection like when using the local vendor/cache to do the update

move compress to the bootstrap environment as being used in the plugin manager means not being loaded with logstash-core

Bring pack cached gems in the vendor directory so they can be used for bundler when packaging dependencies

Revert "Bring pack cached gems in the vendor directory so they can be used for bundler when packaging dependencies"

This reverts commit a9d7f46649932b06efaafebdd0eed2b4c63c2235.

patch the Bundler::Source::Rubygems to fetch only gems from a remote  source

small changes in several parts of the plugin manager and the creation of a common pack command with shared code

change compress to read in chuncks

fix wrong var name in the bootstrap compress utils module

fix namespacing conflicts

add basic test for the compress utility module

ammend more namespace issues

add a comment to the rubygems mockey patch to rebuild the gem cache

apply cosmetic changes

make the compress module raise CompressError

remove vendor_path and pattern_path form environment as they where mix up during rebase

change the bin/pack force option to be force-delete-cache

rename force_delete_cache to overwrite

change force for overwrite in tha pack command

remove the override option for bin/plugin unpack

revert Gemfile and Genfile.lock wrong committed
2015-11-18 16:28:50 +01:00
Paul Echeverri
753c295834 Updates formatting to fix the build 2015-11-17 19:09:16 -08:00
Paul Echeverri
b731657b5d Changes Logstash Forwarder references to Beats, updates examples in tutorial
Fixes #4223
2015-11-17 18:28:03 -08:00
Suyog Rao
8015b7f9f8 Uncomment heapdump location
Fixes #4205
2015-11-17 15:53:44 +00:00