Get and set Elasticsearch data via plugin

Hi,

I am developing a custom plugin in Kibana using React, in Kibana 8.8.1.

I want to set and get Elasticsearch data via the plugin. Which of the 2 is a better option?

  1. Elasticsearch service

  1. Data plugin

I want to get data from ES, search in the indices, ... and also be able to set data in ES, if required.

Thanks

Hey @Sheereen,

There is important thing to take into account:

The Elasticsearch service is only available server side. If you want to get data on the client side, you have to use Data plugin APIs.

The choice depends on your plugin architecture. You can look at discover plugin code for inspiration.

Best regards, Dzmitry

1 Like

Thanks for your reply

So apart from availability on client and server side, both Elasticsearch-service and data-plugin can be used for both get and set operations on ES data?

Afaik Data plugin mostly focused on data read (like search & query) and optimised to do it efficiently. It totally makes sense to use it for ES data reading but it might not cover particular your case.

Elasticsearch service gives you flexibility with access to Elasticsearch client APIs. So if you plan to write to your data indexes from Kibana, it should give you many options.

Regards, Dima

1 Like

Is it okay to use both?
Data plugin for reach and search operations.
Elasticsearch service for write operations

Is it okay to use both?

Yes, I think we already have some plugins doing the same.

1 Like

Would be great if you could share references... Thanks

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