Skip to content

[DISCUSS] API for selecting data sources, index aliases, and indices  #64858

@mattkime

Description

@mattkime

In support of Data streams - elastic/elasticsearch#53100

tldr; We need a way to select data streams, index aliases, and indices in such a way that we show the user which entities their wildcard matches.

tl;

Initial display of indices -

Screen Shot 2020-04-29 at 8 30 04 PM

Display of matched indices -

Screen Shot 2020-04-29 at 8 30 40 PM

Currently we only display indices with at least one document. You can match an index alias but we don't indicate you match it, we just show the indices it references. Finding a document is important as we store a list of fields with the index pattern saved object. We could display an error if a wildcard matches an index without documents.

We may want to add metadata to the entities returned but currently have no defined needs. Let's make sure its easy to add in the future.

This needs to be cross cluster aware. Currently we make two requests when listing indices in the index pattern creation ui - * and *:*. We do this because the cross cluster request is more likely to be slow or fail so its nice to independently error on the cross cluster request.

API proposal:

Request - GET _data_source/{wildcard}
Result -

{
  indices: [{ name: 'index_name'}],
  data_streams: [{name: 'data_stream_name'}],
  index_aliases: [{name: 'index_alias_name'}],
}

I'm unsure if this should be implemented in elasticsearch or kibana. You could duplicate the result with GET * (for indices), GET /_alias and GET /_data_streams/ although the individual APIs might be doing more work than necessary. Speed should be taken into consideration as it affects flexibility of usage. We would prefer that index patterns are quick and easy to create as to facilitate data exploration, unlike now where its treated as a kibana configuration step. Its notable that GET * frequently returns large payloads detailing fields and their capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:Data ViewsData Views code and UI - index patterns before 8.0discuss

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions