logstash/x-pack
Ry Biesemeyer 51886b9102
geoip: extract database manager to stand-alone feature (#15348)
* geoip: extract database manager to stand-alone feature

Introduces an Elastic-licensed GeoipDatabaseManagement tool that can be used
by ANY plugin running on Elastic-licensed Logstash to retrieve a subscription
to a GeoIP database that ensures EULA-compliance and frequent updates, and
migrates the previous Elastic-licensed code-in-Logstash-core extension to
the Geoip Filter to use this new tool, requiring ZERO changes to in-the-wild
versions of the plugin.

The implementation of the new tool follows the previous implementation as
closely as possible, but presents a new interface that ensures that a
consumer can ATOMICALLY subscribe to a database path without risk that the
subscriber will receive an update or expiry before it is finished applying
the initial value:

~~~ ruby
geoip_manager = LogStash::GeoipDatabaseManagement::Manager.instance
subscription = geoip_manager.subscribe('City')

subscription.observe(construct: ->(initial_dbinfo){ },
                     on_update: ->(updated_dbinfo){ },
                     on_expire: ->(       _      ){ })

subscription.release!
~~~

* docs: link in geoip database manager docs

* docs: reorganize pending 'geoip database management' feature

* docs: link to geoip pages from feature index

* geoip: add SubscriptionObserver "interface"

simplifies using Subscription#observe from Java

* geoip: fixup SubscriptionObserver after rename

* geoip: quacking like a SubscriptionObserver is enough

* geoip: simplify constants of legacy geoip filter extension

* geoip: bump logging level to debug for non-actionable log

* geoip: refine log message to omit non-actionable info

* re-enable invokedynamic (was disabled to avoid upstream bug)

* geoip: resolve testing fall-out from filter extension's "private" constants removal

* geoip: consistently use `DataPath#resolve` internally, too
2023-11-06 09:22:23 -08:00
..
ci Introduce LS_JAVA_HOME environment variable (#13204) 2021-09-06 10:22:51 +02:00
lib geoip: extract database manager to stand-alone feature (#15348) 2023-11-06 09:22:23 -08:00
modules Rubocop: Enable most SpaceInside cops (#15201) 2023-07-20 09:49:46 -04:00
qa/integration Rubocop: Enable most SpaceInside cops (#15201) 2023-07-20 09:49:46 -04:00
spec geoip: extract database manager to stand-alone feature (#15348) 2023-11-06 09:22:23 -08:00
src/test/java/org/logstash/xpack/test Refactor: drop redundant (jruby-complete.jar) dependency (#13159) 2022-02-02 06:55:26 +01:00
build.gradle Refactor: drop redundant (jruby-complete.jar) dependency (#13159) 2022-02-02 06:55:26 +01:00
CHANGELOG.md Migrate x-pack-logstash source to logstash 2018-04-24 10:46:15 -05:00
gradle.properties Defensively mark x-pack as a distributed artifact 2018-05-15 19:42:31 +00:00
README.md Migrate x-pack-logstash source to logstash 2018-04-24 10:46:15 -05:00
settings.gradle Load tests via JUnit 2018-05-15 16:15:39 +00:00

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.

Logstash X-Pack

Set of plugins that form Logstash X-Pack features.

Setup

Logstash X-Pack features are a default part of Logstash; as X-Pack features provide integrations with the rest of the Elastic Stack, they will need to be configured to point to an Elasticsearch instance in order to work.

Opting Out of X-Pack

If you are unable or unwilling to run the Elastic-Licensed X-Pack Features and Functions, OSS-only distributions are available from the downloads page; to run Logstash from source without X-Pack, ensure that your environment variable OSS is exported with a value of true:

export OSS=true

Configuration

To configure x-pack settings, you can edit config/logstash.yml and add xpack.* configs from the logstash x-pack settings.

Building documentation

This repo contains information that is used in the Logstash Reference.

To build the Logstash Reference on your local machine, use the docbldls or docbldlsx build commands defined in https://github.com/elastic/docs/blob/master/doc_build_aliases.sh