diff --git a/build.gradle b/build.gradle index e0055fc..8ddc060 100644 --- a/build.gradle +++ b/build.gradle @@ -344,7 +344,7 @@ task buildElasticsearchLogstashBridge(type: Exec) { } } -def ingestGeoipPluginShadeNamespace = "org.elasticsearch.ingest.geoip.shaded" +def ipLocationModuleShadeNamespace = "org.elasticsearch.iplocation.shaded" /** * The StableBridge exposes GeoIP plugin internals, so it needs to relocate references to @@ -360,24 +360,24 @@ task shadeElasticsearchStableBridge(type: com.github.jengelman.gradle.plugins.sh archiveFileName = "logstash-stable-bridge-shaded.jar" destinationDirectory = file("${buildDir}/shaded") - relocate('com.fasterxml.jackson', "${ingestGeoipPluginShadeNamespace}.com.fasterxml.jackson") - relocate('com.maxmind', "${ingestGeoipPluginShadeNamespace}.com.maxmind") + relocate('com.fasterxml.jackson', "${ipLocationModuleShadeNamespace}.com.fasterxml.jackson") + relocate('com.maxmind', "${ipLocationModuleShadeNamespace}.com.maxmind") mergeServiceFiles() } -task shadeElasticsearchIngestGeoIpModule(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { - description "Shades embedded dependencies of the Elasticsearch Ingest GeoIP module" +task shadeElasticsearchIpLocationModule(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { + description "Shades embedded dependencies of the Elasticsearch IP location module" dependsOn buildElasticsearchLocalDistro - from(buildElasticsearchLocalDistro.module("ingest-geoip").orElse(objects.fileCollection())) + from(buildElasticsearchLocalDistro.module("ip-location").orElse(objects.fileCollection())) - archiveFileName = 'ingest-geoip-shaded.jar' + archiveFileName = 'ip-location-shaded.jar' destinationDirectory = file("${buildDir}/shaded") - relocate('com.fasterxml.jackson', "${ingestGeoipPluginShadeNamespace}.com.fasterxml.jackson") - relocate('com.maxmind', "${ingestGeoipPluginShadeNamespace}.com.maxmind") + relocate('com.fasterxml.jackson', "${ipLocationModuleShadeNamespace}.com.fasterxml.jackson") + relocate('com.maxmind', "${ipLocationModuleShadeNamespace}.com.maxmind") mergeServiceFiles() @@ -433,7 +433,7 @@ task importMinimalElasticsearch() { dependsOn buildElasticsearchLocalDistro dependsOn shadeElasticsearchStableBridge - dependsOn shadeElasticsearchIngestGeoIpModule + dependsOn shadeElasticsearchIpLocationModule dependsOn shadeElasticsearchGrokImplementation dependsOn shadeElasticsearchRedactPlugin @@ -453,6 +453,7 @@ task importMinimalElasticsearch() { include jarPackageNamed("elasticsearch-x-content") include jarPackageNamed("elasticsearch-geo") include jarPackageNamed("elasticsearch-user-agent-api") + include jarPackageNamed("elasticsearch-ip-location-api") include jarPackageNamed("lucene-core") include jarPackageNamed("lucene-analysis-common") include jarPackageNamed("hppc") @@ -471,7 +472,11 @@ task importMinimalElasticsearch() { include jarPackageNamed("user-agent") } - from(shadeElasticsearchIngestGeoIpModule) + from(shadeElasticsearchIpLocationModule) + from(buildElasticsearchLocalDistro.module("ingest-ip-location")) { + include jarPackageNamed("ingest-ip-location") + } + from(shadeElasticsearchRedactPlugin) from(buildElasticsearchLocalDistro.module("lang-mustache")) { @@ -1008,4 +1013,5 @@ task unitSpecs(dependsOn: bundleInstall) { clean { delete "${projectDir}/*.gem" delete "build" + delete "vendor/jar-dependencies" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 89483d2..7d341c9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,3 @@ LOGSTASH_PATH=../../logstash -ELASTICSEARCH_TREEISH=main +ELASTICSEARCH_REPO=eyalkoren/elasticsearch +ELASTICSEARCH_TREEISH=refactor-geoip diff --git a/src/main/java/co/elastic/logstash/filters/elasticintegration/geoip/IpDatabaseAdapter.java b/src/main/java/co/elastic/logstash/filters/elasticintegration/geoip/IpDatabaseAdapter.java index f96ef40..b36c70b 100644 --- a/src/main/java/co/elastic/logstash/filters/elasticintegration/geoip/IpDatabaseAdapter.java +++ b/src/main/java/co/elastic/logstash/filters/elasticintegration/geoip/IpDatabaseAdapter.java @@ -10,11 +10,10 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.logstashbridge.core.CheckedBiFunctionBridge; import org.elasticsearch.logstashbridge.geoip.AbstractExternalIpDatabaseBridge; -import org.elasticsearch.logstashbridge.geoip.IpDatabaseBridge; -import org.elasticsearch.ingest.geoip.shaded.com.maxmind.db.CHMCache; -import org.elasticsearch.ingest.geoip.shaded.com.maxmind.db.NoCache; -import org.elasticsearch.ingest.geoip.shaded.com.maxmind.db.NodeCache; -import org.elasticsearch.ingest.geoip.shaded.com.maxmind.db.Reader; +import org.elasticsearch.iplocation.shaded.com.maxmind.db.CHMCache; +import org.elasticsearch.iplocation.shaded.com.maxmind.db.NoCache; +import org.elasticsearch.iplocation.shaded.com.maxmind.db.NodeCache; +import org.elasticsearch.iplocation.shaded.com.maxmind.db.Reader; import java.io.File; import java.io.IOException;