Kibana[7.3] load custom vector shape from http server

Hi There,
I am trying to add a few vector shape files in geojson format to Kibana (running on ubuntu 18.04)
Here are what I did:
1- set up a http server for my geojson files using: python3 -m http.server 8080
2- set up a reverse proxy in Nginx to allow external access to http server

server {
listen 81;

    server_name aa.aa.aa.aa;
    location / {
        proxy_pass http://bb.bb.bb.bb:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

3- config kibana.yml

map.regionmap:
includeElasticMapsService: false
layers:
- name: "xx"
url: "http://localhost:81/my.geojson"
fields:
- name: "xxxt"
description: "xxx"

However, Kibana is still not able to load my.geojson
Can anyone please give some advice?

Thanks.

Hi @Scorpion21,

Can you make sure this URL http://localhost:81/my.geojson is accessible from the server where Kibana runs?

Also what do you mean exactly by Kibana is still not able to load my.geojson? Do you see errors in the UI or logs or ...?

Best,
Oleg

hi @Scorpion21

The preferred solution at the end, but I'll respond to your question first.

Your proxy-configuration here does not apply to custom region maps, configured in the kibana.yml. For those, the Kibana application (in the user's browser) issues a CORS-request directly to the server that is hosting the region-file. So the first thing to check would be to see if your server (localhost:81) is allowing CORS-requests. For more info, see here https://www.elastic.co/guide/en/kibana/current/settings.html#regionmap-settings.

... Preferred solution

If possible though, the preferred solution would be to index your geojson file into Elasticsearch. In 7.3, you can do that easily with the "Upload geojson" feature. (click Add layer, it's the first option).

Once you indexed your file like that, just add your data as an ES-document layer. To be more efficient, you can turn off the "Apply global filters" switch and the "Filter on extent" switch. That way, it will only pull the file once.

The biggest advantage is that you then will not have to worry about CORS-settings or maintaining a separate server for your custom file.

yes I am pretty sure that this URL http://localhost:81/my.geojson is accessible from the server where Kibana runs.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.