Skip to content

Commit f8fdb8a

Browse files
committed
URI encode the index names we fetch in the fetchIndices lib function.
1 parent 9519fcd commit f8fdb8a

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
@@ -44,7 +44,9 @@ async function fetchIndicesCall(
4444
// This call retrieves alias and settings (incl. hidden status) information about indices
4545
const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', {
4646
method: 'GET',
47-
path: `/${indexNamesString}`,
47+
// transport.request doesn't do any URI encoding, unlike other JS client APIs. This enables
48+
// working with Logstash indices with names like %{[@metadata][beat]}-%{[@metadata][version]}.
49+
path: `/${encodeURIComponent(indexNamesString)}`,
4850
query: {
4951
expand_wildcards: 'hidden,all',
5052
},

0 commit comments

Comments
 (0)