Commit graph

3669 commits

Author SHA1 Message Date
Pere Urbon-Bayes
0c1972a075 add more control on valid arguments for codecs in the generator command
Fixes #5419
2016-06-01 16:06:19 +00:00
Aaron Mildenstein
e40ecbb6b8 Update existing packaging to use /usr/lib/logstash
Update after-install scripts

Use /usr/lib/logstash instead of /opt/logstash

More revisions.

Using `/usr/share/logstash` instead of `/usr/lib/logstash`

Track these new files

More work in progress.

Proper arg parsing obtained

WIP: Use jvm.options like ES

Remove facter dependency

Due to an update from @jordansissel on pleaserun, facter is no longer necessary

Revert Gemfile to proper version

Latest work in progress.

I added a simple test to logstash.lib.sh to catch empty strings in java options.

Added `startup.options`, and touched up `jvm.options`

Edited the package scripts to make things play nice with new paths.

Tweaked `system-install` to allow users to provide their own `startup.options` file.

Patch up merge failure

Changes to work with the new logstash.yml

Add fpm dependency (build fails without it)

Fix missing gems in Gemfile

Don't know how these got lost

Use /etc/logstash for configuration in packages

Update the instructions/documentation for...

...startup.options

Merging proposed changes

Remove mustache and clamp

They're covered by pleaserun anyway

Prune config dir from /usr/share/logstash...

...but only when using RPM/DEB packages

Fixes #5341
2016-05-25 17:25:26 +00:00
Philippe Weber
f2cf64326a fix config_name for generated input plugin
Fixes #5355
2016-05-24 22:00:38 +00:00
Philippe Weber
cd30aa94a8 use new event api in generator filter template
Fixes #5355
2016-05-24 22:00:38 +00:00
Philippe Weber
9c4bac70a5 display correct path of created files
Fixes #5355
2016-05-24 22:00:37 +00:00
Philippe Weber
0665497ca5 make plugin name parameter required
Fixes #5355
2016-05-24 22:00:37 +00:00
Philippe Weber
53c0bc1cf7 fix to allow direct execution of 'bundle install'
Fixes #5355
2016-05-24 22:00:37 +00:00
Pere Urbon-Bayes
1d5fc5735a Add a new command that generate a plugin skeleton that can be used to create a new plugin
Fixes #4190
2016-05-24 16:14:46 +00:00
Joao Duarte
7783f76a4c introduce yaml settings file and cli long switches
* by default lives in LOGSTASH_HOME/config/logstash.yml
* location can be changed by $LS_SETTINGS_DIR or --path.settings
* overrides defaults of LogStash::Environment, BUT
* CLI flags override the yaml file
* several breaking changes to cli flag names (see config/logstash.yml)
* setting values are now type checked (see Setting and Settings classes)

Fixes #5313
2016-05-19 18:15:12 +00:00
Jordan Sissel
07887f8cf7 Include ci/reporter so bin/rpsec works for me.
Fixes #4820
2016-05-09 19:53:17 +00:00
Colin Surprenant
ccefeaeb84 add --preserve option to plugin install
add missing overwrite method and preserve @gems_by_name when updating

log options preservation

discards no constrains constrains

rewording
2016-04-29 16:10:11 -04:00
Pier-Hugues Pellerin
ce2e1755e8 Enable DEBUG=1 when using bundler related task
When running any logstash's command you can use DEBUG=1 which should
give the user a bit more information about what LS is doing.

This PR changes the behavior of bundler to make sure its run with the
`--verbose` flag.

Fixes #5199
2016-04-27 13:05:10 +00:00
Suyog Rao
683302e26d Rename bin/plugin to bin/logstash-plugin
This adds support for packs and fixes the problem where bin/plugin
pollutes the PATH namespace

Fixes #4871

Fixes #4874
2016-03-24 00:23:15 +00:00
Joao Duarte
e32f732dba support multiple pipeline reloading and other cleanups
* serialize upgrade_state and running_pipelines?
* remove useless @thread from pipeline
* remove agent registry and cleanup
* reduce reload_interval from 5 to 3
* remove useless MissingAgentError class
* fix exit codes for reload_state failures
* explain why thread var exists in agent.rb
* properly pass backtrace exceptions to oops
* remove is_config_test from loader

Fixes #4520
2016-02-05 12:44:52 +00:00
Joao Duarte
00a99c19e5 refactor concerns of runner, agent and pipeline
* move cli argument handling from agent to runner
* add a short-help message
* add interactive shell option
* log fatal messages to terminal when logging to file
* change docs:generate task to use bundle exec

Fixes #3872
2015-11-25 12:11:36 +00:00
Pere Urbon-Bayes
2195f145b2 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 12:03:51 +01:00
Pere Urbon-Bayes
ba96b1f0b3 Fix the plugin manager install and update commands to perform the validation properly when a private gem server (not rubygems) has been configured. This basically loads the sources so the system is able to perform the validation with the right destionation and not with the default source (rubygems.org)
Former commits:

add all defined sources to rubygems so verification can talk to all the repositories, even the private ones

added a very simple plugin manager install command spec, to check for properly loading sources when validating

broke long lines into smaller ones in the install command

make sure the update command takes into account all declared sources, plus there is the option to avoid gem validation in case of only having a private gem repo and no internet connection

fix wrong conditional in the validation of plugins

move the Gem.sources loading to a common place, to sources are loaded all at once and we don't need to worry on each call to be sure we do the right thing for other sources different that rubygems

update test to the last changes in the way gemfile is loaded

move Gem::SourceList.from to bundler::invoke! so we use the default gemset.sources array

fix loading path for Gem::SourceList in bundler, so it's not colliding with other classes

Revert "move the Gem.sources loading to a common place, to sources are loaded all at once and we don't need to worry on each call to be sure we do the right thing for other sources different that rubygems"

This reverts commit 6e1c809665d61495b5461e7522a7adc745fe27fc.

Revert "update test to the last changes in the way gemfile is loaded"

This reverts commit dc5f65c2ac5380b1640cb732946f1a8ababcc9dc.

make the Gem.sources load to happen inside the logstash_plugin? call

add the idea of settings to the plugin manager module, like this we can pass throw different stuff usefull to setup dependant components

add the install spec back

remove the PluginManager::Settings concept

change sources for rubygems_sources in the plugin manager options

change rubygems_sources to be rubygems_source

update comments

ammend plugin manager options description in the comments

spaces and new lines cleanup

merged duplicated plugin manager util_spec introduced during rebase

add a check when Gems.versions fail

Add the validation exception for the plugin manager

add better error handling for situation where the validation is not possible due to a connection issue with the remote server

Fixes #3583
2015-11-17 08:38:55 +00:00
Colin Surprenant
d74d41cb30 logstash-core & logstash-core-event extraction to support logstash-core-event-java impl, relates to #4191
fixed timezone issue

extracted logstash-core and reorganized specs

extracted logstash-core-event

extract java Event into logstash-core-event-java in a proper gem

remove obsolete jruby_event bootstrapping

fix require path

add java code bootstrap

use logstash-core-event/logstash-core-event.rb

remove obsolete files

basic instructions

LogStash::Json need to be initialized from event

update jruby and gradle versions

update compile:logstash-core-event-java rake task

WIP tasks refactor

fix gem.files

skip test if class is not defined

fix gem related tasks for new structure

add gem spec dirs in core tests

bootstrap java implementation when requiring timestamp

new Cloner class and Event clone impl

fix array fields assignments, see #4140

don't rely on json implementation ordering

fix skipped last iterpolation char

remove implementation specific unnecessary check

also require ruby classes

define error class in ruby

raise exception on invalid format

remove implementation specific tests and extract and put logger related test in pending

missing bits for having all core timestamp specs pass

run all core specs

remove leftover

comment regex

missing encoding header

revert to logstash-core-event by default

finished proper gemification

useless require

dynamically pick specs depending on logstash-core-event-* implementation

logstash root package version

missing file for proper gemification

do not build java event by default

always check for root logstash lib dir

fix concurrent-ruby version confict

fix rebase conflict

re-enable specs

user vars instead of constants

move non core code in bootstrap

document version files

move version file

remove useless code

use version in logstash-core

fix gem files list

put back concurrent-ruby version constrain as in master

add dependency on logstash-core-event

remove dependency on logstash-core to avoid circular dependency

fix rebase conflict

remove circular dependency

fix specs

update README
2015-11-16 16:40:19 -05:00
Tal Levy
e28f188e12 refactor to gradle project, relates to #4191
more event java updates

- updated metadata
- moved #append to java
- other small test fixes

commit gradle wrapper jar
2015-11-16 16:39:47 -05:00
Colin Surprenant
4ada9363f9 more Event java impl, relates to #4191
event clone

append in Ruby

tag & append

add timestamp assignment spec

comment out original classes

fix at signature

implemented del

remove from array

del test
2015-11-16 16:38:40 -05:00
Colin Surprenant
e5fb1d2977 logstash-core-event-java initial impl, relates to #4191
wip initial Accessors, Event, EventImpl, Path, Timestamp and PathTest

wip

wip

FieldReference and Accessors implementation

rename targetCache to lut and set it protected

initial Accessors tests

todo comment

more tests

Timestamp implementation

Timestamp tests

fix method name

add Long constructor

event initialization, timestamp handling and json serialization

add <> type information

custom json serializer for Timestamp

remove toJson test

initial Event test

more tests

comments

debug traces

initial jruby Event wrapper and specs

added PathCache

implemented includes

added clone

wrap all Event methods

Rakefile to build and jar

missing getters and implement overwrite

support Date conversion

proper cast and coercion

replace Ruby Event with Java Event

test for field reference setter type coercion

disable specs

timestap setter should also set in map, accept more timestamp types

pre cache timestamp and expose isTimestamp

constructor from DateTime

expose proper Ruby Timestamp object

Ruby Timestamp basic specs

also load JRuby Timestamp

transpose Java<->Ruby Timestamp

fix timestamp specs

new jar

cleanup object construction
2015-11-16 16:35:26 -05:00
Aaron Mildenstein
d514ba550f Add config file output to --configtest
This only works when the `--debug` flag is also enabled.

fixes #3243

Changes to log formatting per request

Change :file to :config_file

:file gets overridden by `logstash/agent.rb`, so a different symbol
is necessary.  Changing to `:config_file`

Fixes #4182
2015-11-12 18:35:21 +00:00
Pier-Hugues Pellerin
972e13d52e Since concurrent-ruby 0.9.2 this patch isnt necessary.
The team behind concurrent ruby will now support JDK 7 in the 1.x
release

Fixes #4141

Fixes #4146
2015-11-05 14:44:25 +00:00
Pier-Hugues Pellerin
cbdeb166e3 Deprecated method to_event in input.base
No current plugins uses this and it was deprecated since at least 1.4.2

Fixes #4114
2015-10-30 19:56:05 +00:00
Pier-Hugues Pellerin
9745e9906d Unused constant CONFIGSORT
Fixes #4112
2015-10-30 19:50:19 +00:00
Pier-Hugues Pellerin
5a964b7272 Unused requires in outputs/base
Fixes #4113
2015-10-30 19:49:55 +00:00
Pier-Hugues Pellerin
31bf33c1c7 RESERVED doesn't do anything
Fixes #4115
2015-10-30 19:49:27 +00:00
Aaron Mildenstein
eb8f6387f3 Replace "Install" with "Update" where appropriate
fixes #4116

Fixes #4117
2015-10-29 18:41:29 +00:00
Colin Surprenant
b21331bbcd add before_stop shutdown hook and refactor inflight reporter to use it in agent
Fixes #4024
2015-10-14 00:19:44 +00:00
guyboertje
26fb4bdbe0 Bump JrJackson gem to 0.3.5 and make adjustments to use it 2015-10-13 14:25:12 -07:00
Pier-Hugues Pellerin
4e300a8a41 Added clearer message when a filter crash
When the filter workers crash Logstash will stop consuming any events,
Since we don't have a dead letter queue yet, we can't restart the
workers.

Fixes #3983

Fixes #3990
2015-10-13 16:34:41 +00:00
Pier-Hugues Pellerin
93958be3cd Uses not in syntax instead of !( .. )
Fixes #4011
2015-10-13 16:18:15 +00:00
Pier-Hugues Pellerin
dbb034ec45 Plugin#params should not return obsolete params
Fixes #4011
2015-10-13 16:18:15 +00:00
Suyog Rao
62c42be8e2 Remove deprecated config options. Will also make docs nicer
Fixes #4011
2015-10-13 16:18:15 +00:00
Pier-Hugues Pellerin
7e098c6477 Allow TLSv1.2 for Lumberjack or TCP input connections
This patch requires the use of the latest version of `jruby-openssl`
which support TLSv1.2. This PRs changes the monkeypatch to specify to
set the `ssl_version` to `TLS` which allow support of TLSv1, TLSv1.1 and
TLSv1.2.

Fixes #3955, #3991
2015-10-12 13:38:55 -07:00
Pier-Hugues Pellerin
90b6191ec2 Change master version for 3.0.0
Fixes #3999
2015-10-08 13:57:08 +00:00
Jordan Sissel
7e7e4c8719 New plugin config attribute :obsolete
An obsolete setting is one that will cause a configuration error if it
is used.

The purpose of `:obsolete` is to help inform users when a setting has
been completely removed. The lifecycle of a plugin setting is now 4
phases: available, deprecated, obsolete, deleted.

"Available" is the default, and deprecated remains the same as it was
(logging a warning). The new obsolete will cause a configuration error
if such a setting is used. Then later, we can finally delete the config
setting after it's been obsolete for some time.

Fixes #3977

Fixes #3978
2015-10-02 09:31:29 +00:00
guyboertje
5b47009648 Add basic defaults module and spec. Use defaults in pipeline and agent
move/rename defaults under config, use Concurrent.processor_count
remove method `filter_workers_count`

add CpuCoreStrategy module functions/tests. Use fifty_percent as default.

use extend self for Module functions

added defaults printing facility

change comment

add tests to defaults printer subsystem

closes #3852
2015-09-24 14:59:05 +01:00
Joao Duarte
112b28149e rename teardown to close
remove edge case when running from rubinius

add do_stop and do_close to avoid using super
2015-09-18 16:23:40 -04:00
Colin Surprenant
5adf2b0426 removed started? and use AtomicBoolean for ready?
cleanup @filter_to_output initialization

remove @run_mutex, use ready? to synchonize shutdown agains startup sequence

remove ShutdownSignal handling & cleanup
2015-09-18 16:22:50 -04:00
Joao Duarte
3bdac41a6c trigger input plugin shutdown using out of band call
Currently, during shutdown, the pipeline loops through input workers
and calls Thread.raise on each input thread. Plugins rescue that
exception to exit the `run` loop. Afterwards, `teardown` is called for
any additional bookkeeping.

This proposal exposes a `stop` call on the input plugin class to alert
an input that it should shutdown. It is the plugin job to frequently
poll an internal `stop?` method to know if it's time to exit and
terminate if so.

The `teardown` method remains to do the additional bookkeeping, and it
will be called by the inputworker when `run` terminates.

add concurrent-ruby as logstash-core dependency

make Plugins::Input#stop? public

In some scenarios it's necessary for the inputworker or the pipeline
to know that the plugin is in a shutdown mode

document why inputworker sleeps on StandardError

better debug message when input plugin raises exception during shutdown
2015-09-18 16:22:30 -04:00
Pier-Hugues Pellerin
186806d64c Cleanup of require-helper.rb
This file isn't used in the code at all, It was probably used at some
point but its not the case anymore.

Fixes #3938
2015-09-18 18:20:32 +00:00
Pier-Hugues Pellerin
0ae58804ee Remove multiqueue
This file was probably used at some point but its not the case anymore

Fixes #3939
2015-09-18 18:20:13 +00:00
Pier-Hugues Pellerin
fe68307991 Remove unused files
Remove related files for compiling the treetop grammar we have refactored the
makefile using rake. If you want to generate a new parser you can use
this command.

`rake compile:all`

Fixes #3941
2015-09-18 18:19:38 +00:00
Pier-Hugues Pellerin
935ac9285b String Interpolation skip the last character
This PR fix a problem when doing the interpolation with a string that
did not end with a fieldref but with a character. The interpolation was
ignoring the last character.

Example:
```
"%{type}|" => "syslog"
```

Fixes #3931

Fixes #3937
2015-09-18 15:39:44 +00:00
Pier-Hugues Pellerin
b863ace5ab Silence deprecation warnings from concurrent-ruby
Concurrent-ruby is throwing warning when running under jdk7,
we have decided to silence theses errors unless you run logstash with
the `--debug` flag.

Fixes #3869
2015-09-15 13:04:12 -07:00
Pere Urbon-Bayes
a3fc9476cc Fix the update command to only work with installed plugins gems so it's not having problems with not purged plugins
Fixes #3731
2015-09-11 06:49:54 +00:00
Suyog Rao
309611ba52 Revert version change to 2.0.0.dev because plugins constraint checks fail
Fixes #3865
2015-09-03 20:16:45 +00:00
Suyog Rao
bdacba71e3 Bump master to next version
Fixes #3863
2015-09-03 19:45:54 +00:00
guyboertje
7bb94d0692 add test for compact and compact! in java_integrations
Fixes #3772
2015-09-03 19:43:10 +00:00