I am new to the forum, but not new to Elastic Stack. I have been using it for about 7 years. Started with Version 5 and upgraded to 8 over time.
Sorry for the long post but felt that some foundation was necessary.
Current Elastic Stack install is Version 8.11.0
Logstash Geoip Processor - using a custom mmdb file -
is working perfectly on 3 pipelines.
BUT
in Kibana - adding geoip processor to an ingest-pipeline fails -
using the same custom mmdb
Testing in curl using simulate
The following test works:
curl --cacert http_ca.crt -X POST -u user:pass "https://localhost:9200/_ingest/pipeline/_simulate?pretty" -H 'Content-Type: application/json' -d'
{
"pipeline" :
{
"description": "_GEO",
"processors": [
{
"geoip": {
"field": "ip",
"target_field": "geo"
}
}
]
},
"docs": [
{
"_index": "index",
"_id": "id",
"_source": {
"foo": "bar",
"ip": "10.18.106.44"
}
}
]
}
'
Result:
{
"docs" : [
{
"doc" : {
"_index" : "index",
"_version" : "-3",
"_id" : "id",
"_source" : {
"geo" : {
"continent_name" : "North America",
"country_name" : "United States",
"location" : {
"lon" : -97.822,
"lat" : 37.751
},
"country_iso_code" : "US"
},
"foo" : "bar",
"ip" : "10.18.106.44"
},
"_ingest" : {
"timestamp" : "2024-03-11T15:02:42.258728904Z"
}
}
}
]
}
The following test fails:
curl --cacert http_ca.crt -X POST -u user:pass "https://localhost:9200/_ingest/pipeline/_simulate?pretty" -H 'Content-Type: application/json' -d'
{
"pipeline" :
{
"description": "_GEO",
"processors": [
{
"geoip": {
"field": "ip",
"target_field": "geo",
"database_file": "Custom-City.mmdb"
}
}
]
},
"docs": [
{
"_index": "index",
"_id": "id",
"_source": {
"foo": "bar",
"ip": "10.18.106.44"
}
}
]
}
'
Result:
{
"docs" : [
{
"error" : {
"root_cause" : [
{
"type" : "runtime_exception",
"reason" : "java.lang.NullPointerException: Cannot invoke \"Object.getClass()\" because \"parameters[index]\" is null"
}
],
"type" : "runtime_exception",
"reason" : "java.lang.NullPointerException: Cannot invoke \"Object.getClass()\" because \"parameters[index]\" is null",
"caused_by" : {
"type" : "null_pointer_exception",
"reason" : "Cannot invoke \"Object.getClass()\" because \"parameters[index]\" is null"
}
}
}
]
}
in Logstash Filter - This is working perfectly.
# GeoIP location services for source
geoip {
database => "/etc/elasticsearch/ingest-geoip/Custom-City.mmdb"
source => "[sourceIP]"
target => source
} # geoip
# GeoIP location services for destination
geoip {
database => "/etc/elasticsearch/ingest-geoip/Custom-City.mmdb"
source => "[destinationIP]"
target => destination
} # geoip
There is only one Custom-City.mmdb on my system.
It contains my Local IP subnets, and is regenerated and deployed nightly.
The GeoLite2 files are updated weekly.
They are all located in /etc/elasticsearch/ingest-geoip
-rw-r--r--. 1 xx xx 137333 Mar 11 03:43 Custom-City.mmdb
-rw-r--r--. 1 xx xx 8414134 Mar 8 10:34 GeoLite2-ASN.mmdb
-rw-r--r--. 1 xx xx 63829032 Mar 8 16:12 GeoLite2-City.mmdb
-rw-r--r--. 1 xx xx 6381855 Mar 8 16:14 GeoLite2-Country.mmdb
I use go code to create the custom mmdb file from a MySQL Database.
If you need to see the go code let me know.
Please let me know about the code used in Logstash versus the Ingest Pipeline GeoIP code. Are they different? Can the code in Ingest processor get updated to work the same way the Logstash Filter GeoIP works?
Thanks
Steve B