How to add a map using GeoServer and kibana 8.10

Hi there Elastic team,

I'm looking for some guidance on how to add a custom map using a geoserver. I have went over the instructions on this blog Kibana and a Custom Tile Server for NHL Data | Elastic Blog and and I can't make it to work. I'm using Kibana 8.10 and GeoServer 2.23. Any guidance on how to troubleshoot this?
i think the problem is with the tile format({z}/{x}/{y}.png) that the kibana need and what the right format for the geoServer.
I would be happy to receive help later on the attached guide, how do I add the appropriate link to Kibana
Thank you

Hi @Erez_Danieli. It looks like you are trying to add a WMS layer from Geoserver. But you've chosen to add a "Tile Map Service" layer. Try adding a layer again, but choose the "Web Map Service" layer instead.

1 Like

Thank you very much, there is significant progress, I repeated exactly the guide again, this time with the change you mentioned("Web Map Service" layer). There is still a problem.

I note that the geoserver
works without a problem (test it with qgis)


maybe something with the kibana.yml?

You can use the browser developer tools to see the exact error you are seeing. It may be the name of the style or something different.

If you open the layer preview in the GeoServer interface using the same Web Map Service protocol (WMS), you can compare the network requests between kibana and that preview to find the difference.

Sorry for the vague answers, but without better error messaging, it is hard to know exactly what's wrong with your setup.

1 Like

I just run the official docker image with the relevant bit of enabling CORS

$ mkdir /tmp/geoserver
$ docker run --rm --name geoserver \
  -v /tmp/geoserver:/opt/geoserver_data \
  -p 8080:8080 --env CORS_ENABLED=true \
  docker.osgeo.org/geoserver:2.23.x

Without any further configuration, I could add the nl:countries world layer to Kibana Maps just loading the WMS endpoint

http://localhost:8080/geoserver/ne/wms

Because the layer has a default style I don't need to select any and it just loads fine.

Peek 2023-10-17 09-53

I would recommend starting from this initial setting to test things.

2 Likes

Very professional answer, problem solved.
I looked at the messages sent between the geoserver and the kibana and saw that CORS was missing, in addition to the fact that I saw that it appears in your example.
I updated the geoserver WEB-INF on the server:
File location:
geoserver/webapps/geoserver/WEB-INF
The following lines must be enabled:

   <!-- Uncomment following filter to enable CORS in Jetty. Do not forget the second config block further down. -->
	<filter>
  	<filter-name>cross-origin</filter-name>
  	<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
  	<init-param>
    	<param-name>chainPreflight</param-name>
    	<param-value>false</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedOrigins</param-name>
    	<param-value>*</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedMethods</param-name>
    	<param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
  	</init-param>
  	<init-param>
    	<param-name>allowedHeaders</param-name>
    	<param-value>*</param-value>
  	</init-param>
	</filter>

	<!-- Uncomment following filter-mapping to enable CORS -->
	<filter-mapping>
    	<filter-name>cross-origin</filter-name>
    	<url-pattern>/*</url-pattern>
	</filter-mapping>
    
   
	<filter-mapping>
  	<filter-name>FlushSafeFilter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>
    
	<filter-mapping>
  	<filter-name>SessionDebugger</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
  	<filter-name>GZIP Compression Filter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
  	<filter-name>xFrameOptionsFilter</filter-name>
  	<url-pattern>/*</url-pattern>
	</filter-mapping>

Thank you

1 Like

Glad it worked!

Definitely, the CORS setting is always a source of issues for Geoserver users, but fortunately, it's an easy one to spot and fix, and the project docs cover this very well.

Cheers!

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