Skip to content

Commit

Permalink
URI encode the index names we fetch in the fetchIndices lib function. (
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Sep 4, 2020
1 parent 8e2f252 commit 1822296
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ async function fetchIndicesCall(
// This call retrieves alias and settings (incl. hidden status) information about indices
const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', {
method: 'GET',
path: `/${indexNamesString}`,
// transport.request doesn't do any URI encoding, unlike other JS client APIs. This enables
// working with Logstash indices with names like %{[@metadata][beat]}-%{[@metadata][version]}.
path: `/${encodeURIComponent(indexNamesString)}`,
query: {
expand_wildcards: 'hidden,all',
},
Expand Down

0 comments on commit 1822296

Please sign in to comment.