Skip to content

Commit 2eb8dac

Browse files
URI encode the index names we fetch in the fetchIndices lib function. (#76584)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent ae093e5 commit 2eb8dac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/plugins/index_management/server/lib/fetch_indices.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async function fetchIndicesCall(
4545
// This call retrieves alias and settings (incl. hidden status) information about indices
4646
const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', {
4747
method: 'GET',
48-
path: `/${indexNamesString}`,
48+
// transport.request doesn't do any URI encoding, unlike other JS client APIs. This enables
49+
// working with Logstash indices with names like %{[@metadata][beat]}-%{[@metadata][version]}.
50+
path: `/${encodeURIComponent(indexNamesString)}`,
4951
query: {
5052
expand_wildcards: 'hidden,all',
5153
},

0 commit comments

Comments
 (0)