-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ip2geo does not provide information from the database automatically #678
Comments
The You need to explicitly say it is geo point in your index mapping. |
HI @sasha2484. I am confused what is the actual issue you are facing now. |
The general point is that pipeline does not read the ip from the clientid field.
=> {
POST _ingest/pipeline/my-pipeline/_simulate => {
|
Could you tell how did you ingest the doc? I see you were able to process clientip field in your previous example. It does not work anymore?
|
I used the instructions from here: PUT /nginx-2024.09.05/_doc/my-id?pipeline=my-pipeline GET /nginx-2024.09.05/_doc/my-id That is, when I poison such a request with my hands through DevTools, then everything works as expected. But pipeline itself does not want to work in automatic mode for new indexes and new data that come in. I create a new nginx index every day-{date}, where the clientip field with ip addresses is present. It feels like I'm missing some little thing, but I can't find it in any way. I've tried creating different pipelines, with different names, but none of them want to work. |
I'm trying to see how many documents the "my-pipeline" pipeline has processed in total, but I get zeros I am creating a new index pattern "nginx*" in which I see new fields ip2geo.continent_name and the like. Logically, I should see the data in them, but I don't see it through Discover. |
At the same time, the simulation works => { |
Could you share how you ingest document with automatic mode? |
I accept messages from bots, process it with logstash filters and send it to Opensearch.
|
ip2geo does not provide information from the database automatically
How can one reproduce the bug?
I used this instruction to set up:
https://opensearch.org/docs/2.16/ingest-pipelines/processors/ip2geo/
PUT /_plugins/geospatial/ip2geo/datasource/my-datasource
{
"endpoint" : "https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json",
"update_interval_in_days" : 1
}
{
"acknowledged": true
}
GET /_plugins/geospatial/ip2geo/datasource/my-datasource
{
"datasources": [
{
"name": "my-datasource",
"state": "AVAILABLE",
"endpoint": "https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json",
"update_interval_in_days": 1,
"next_update_at_in_epoch_millis": 1724839387155,
"database": {
"provider": "maxmind",
"sha256_hash": "t7FahuRg6Pjw+kcP0F29ZFAni4HEbX5WJC+1M38hzLU=",
"updated_at_in_epoch_millis": 1724427053000,
"valid_for_in_days": 30,
"fields": [
"country_iso_code",
"country_name",
"continent_name",
"region_iso_code",
"region_name",
"city_name",
"time_zone",
"location"
]
},
"update_stats": {
"last_succeeded_at_in_epoch_millis": 1724752680532,
"last_processing_time_in_millis": 217775
}
}
]
}
PUT /_ingest/pipeline/my-pipeline
{
"description":"convert ip to geo",
"processors":[
{
"ip2geo":{
"field":"clientip",
"datasource":"my-datasource"
}
}
]
}
{
"acknowledged": true
}
POST _ingest/pipeline/my-pipeline/_simulate
{
"docs": [
{
"_index": "testindex1",
"_id": "1",
"_source": {
"clientip": "185.35.83.97"
}
}
]
}
{
"docs": [
{
"doc": {
"_index": "testindex1",
"_id": "1",
"_source": {
"ip2geo": {
"continent_name": "Europe",
"country_name": "Norway",
"location": "59.9452,10.7559",
"country_iso_code": "NO",
"time_zone": "Europe/Oslo"
},
"clientip": "185.35.83.97"
},
"_ingest": {
"timestamp": "2024-08-28T08:55:16.048315377Z"
}
}
}
]
}
PUT /nginx-2024.08.28/_doc/my-id?pipeline=my-pipeline
{
"clientip": "185.35.83.97"
}
{
"_index": "nginx-2024.08.28",
"_id": "my-id",
"_version": 4,
"result": "updated",
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"_seq_no": 24950455,
"_primary_term": 1
}
GET /nginx-2024.08.28/_doc/my-id
{
"_index": "nginx-2024.08.28",
"_id": "my-id",
"_version": 4,
"_seq_no": 24950455,
"_primary_term": 1,
"found": true,
"_source": {
"ip2geo": {
"continent_name": "Europe",
"country_iso_code": "NO",
"country_name": "Norway",
"location": "59.9452,10.7559",
"time_zone": "Europe/Oslo"
},
"clientip": "185.35.83.97"
}
}
I recreated the index nginx-2024.08.28 and saw the fields ip2geo.continent_name, ip2geo.country_name and so on
I can't find them through Discover. And I don't see them on the map.
I understand that if I make a request, the data comes in. But why doesn't it work automatically?
Data with the clientip field is constantly coming in
GET /nginx-2024.08.28/
{
"nginx-2024.08.28": {
"aliases": {},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
.....
"clientip": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
....
What is the expected behavior?
I am waiting for the data in these fields to be used in the map
What is your host/environment?
2.16.0
GET _cat/plugins
node-5 opensearch-alerting 2.16.0.0
node-5 opensearch-anomaly-detection 2.16.0.0
node-5 opensearch-asynchronous-search 2.16.0.0
node-5 opensearch-cross-cluster-replication 2.16.0.0
node-5 opensearch-custom-codecs 2.16.0.0
node-5 opensearch-flow-framework 2.16.0.0
node-5 opensearch-geospatial 2.16.0.0
node-5 opensearch-index-management 2.16.0.0
node-5 opensearch-job-scheduler 2.16.0.0
node-5 opensearch-knn 2.16.0.0
node-5 opensearch-ml 2.16.0.0
node-5 opensearch-neural-search 2.16.0.0
node-5 opensearch-notifications 2.16.0.0
node-5 opensearch-notifications-core 2.16.0.0
node-5 opensearch-observability 2.16.0.0
node-5 opensearch-performance-analyzer 2.16.0.0
node-5 opensearch-reports-scheduler 2.16.0.0
node-5 opensearch-security 2.16.0.0
node-5 opensearch-security-analytics 2.16.0.0
node-5 opensearch-skills 2.16.0.0
node-5 opensearch-sql 2.16.0.0
node-5 query-insights 2.16.0.0
node-2 opensearch-alerting 2.16.0.0
node-2 opensearch-anomaly-detection 2.16.0.0
node-2 opensearch-asynchronous-search 2.16.0.0
node-2 opensearch-cross-cluster-replication 2.16.0.0
node-2 opensearch-custom-codecs 2.16.0.0
node-2 opensearch-flow-framework 2.16.0.0
node-2 opensearch-geospatial 2.16.0.0
node-2 opensearch-index-management 2.16.0.0
node-2 opensearch-job-scheduler 2.16.0.0
node-2 opensearch-knn 2.16.0.0
node-2 opensearch-ml 2.16.0.0
node-2 opensearch-neural-search 2.16.0.0
node-2 opensearch-notifications 2.16.0.0
node-2 opensearch-notifications-core 2.16.0.0
node-2 opensearch-observability 2.16.0.0
node-2 opensearch-performance-analyzer 2.16.0.0
node-2 opensearch-reports-scheduler 2.16.0.0
node-2 opensearch-security 2.16.0.0
node-2 opensearch-security-analytics 2.16.0.0
node-2 opensearch-skills 2.16.0.0
node-2 opensearch-sql 2.16.0.0
node-2 query-insights 2.16.0.0
node-4 opensearch-alerting 2.16.0.0
node-4 opensearch-anomaly-detection 2.16.0.0
node-4 opensearch-asynchronous-search 2.16.0.0
node-4 opensearch-cross-cluster-replication 2.16.0.0
node-4 opensearch-custom-codecs 2.16.0.0
node-4 opensearch-flow-framework 2.16.0.0
node-4 opensearch-geospatial 2.16.0.0
node-4 opensearch-index-management 2.16.0.0
node-4 opensearch-job-scheduler 2.16.0.0
node-4 opensearch-knn 2.16.0.0
node-4 opensearch-ml 2.16.0.0
node-4 opensearch-neural-search 2.16.0.0
node-4 opensearch-notifications 2.16.0.0
node-4 opensearch-notifications-core 2.16.0.0
node-4 opensearch-observability 2.16.0.0
node-4 opensearch-performance-analyzer 2.16.0.0
node-4 opensearch-reports-scheduler 2.16.0.0
node-4 opensearch-security 2.16.0.0
node-4 opensearch-security-analytics 2.16.0.0
node-4 opensearch-skills 2.16.0.0
node-4 opensearch-sql 2.16.0.0
node-4 query-insights 2.16.0.0
node-1 opensearch-alerting 2.16.0.0
node-1 opensearch-anomaly-detection 2.16.0.0
node-1 opensearch-asynchronous-search 2.16.0.0
node-1 opensearch-cross-cluster-replication 2.16.0.0
node-1 opensearch-custom-codecs 2.16.0.0
node-1 opensearch-flow-framework 2.16.0.0
node-1 opensearch-geospatial 2.16.0.0
node-1 opensearch-index-management 2.16.0.0
node-1 opensearch-job-scheduler 2.16.0.0
node-1 opensearch-knn 2.16.0.0
node-1 opensearch-ml 2.16.0.0
node-1 opensearch-neural-search 2.16.0.0
node-1 opensearch-notifications 2.16.0.0
node-1 opensearch-notifications-core 2.16.0.0
node-1 opensearch-observability 2.16.0.0
node-1 opensearch-performance-analyzer 2.16.0.0
node-1 opensearch-reports-scheduler 2.16.0.0
node-1 opensearch-security 2.16.0.0
node-1 opensearch-security-analytics 2.16.0.0
node-1 opensearch-skills 2.16.0.0
node-1 opensearch-sql 2.16.0.0
node-1 query-insights 2.16.0.0
node-3 opensearch-alerting 2.16.0.0
node-3 opensearch-anomaly-detection 2.16.0.0
node-3 opensearch-asynchronous-search 2.16.0.0
node-3 opensearch-cross-cluster-replication 2.16.0.0
node-3 opensearch-custom-codecs 2.16.0.0
node-3 opensearch-flow-framework 2.16.0.0
node-3 opensearch-geospatial 2.16.0.0
node-3 opensearch-index-management 2.16.0.0
node-3 opensearch-job-scheduler 2.16.0.0
node-3 opensearch-knn 2.16.0.0
node-3 opensearch-ml 2.16.0.0
node-3 opensearch-neural-search 2.16.0.0
node-3 opensearch-notifications 2.16.0.0
node-3 opensearch-notifications-core 2.16.0.0
node-3 opensearch-observability 2.16.0.0
node-3 opensearch-performance-analyzer 2.16.0.0
node-3 opensearch-reports-scheduler 2.16.0.0
node-3 opensearch-security 2.16.0.0
node-3 opensearch-security-analytics 2.16.0.0
node-3 opensearch-skills 2.16.0.0
node-3 opensearch-sql 2.16.0.0
node-3 query-insights 2.16.0.0
The text was updated successfully, but these errors were encountered: