Getting saved searches (objects) for plugin use

(Usama Ahmad) #1

Hi, I'm new to kibana and i'm trying to experiment with its plugins.

I want to get the saved searches (Objects) to use in my plugin. e.g. If i saved a search named "nameSearch" with the search content as "nabeel*" . I would like to get this "nameSearch" and the search pattern "nabeel*" in my plugin.

How can I achieve this? Any guidance in this regard is appreciated.

(Peter Pisljar) #2

SavedObjectRegistry would be one way to do that ... for example to get all saved visualizations:

import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
app.controller('TestVisApp', function ($scope, Private, AppState) {
  const services = Private(SavedObjectRegistryProvider).byLoaderPropertiesName;
  const visualizationService = services.visualizations;
  visualizationService.find().then(result => { $scope.savedVisualizations = result.hits; });

(Usama Ahmad) #3

Thanks, @ppisljar for your reply.
Actually I need to get all the saved Searches not visualizations. Can u point me in the right direction or documnetation where i can find the properties of searches instead of visualizations?

(Peter Pisljar) #4

unfortunately there is no documentation around this and the only way to approach it would be to start reading the code, inspecting the variables and figuring out what to do. Probably it would be best to check how this is implemented in management for example, where all the saved objects are listed.

take a look at the following file:

(system) #5

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