From b09e1fd95bcd896e000067c8b45a06f5e27f1445 Mon Sep 17 00:00:00 2001 From: Bryce Buchanan <75274611+bryce-b@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:40:28 -0800 Subject: [PATCH] [8.x] added '\' escapes (#199185) (#199373) # Backport This will backport the following commits from `main` to `8.x`: - [added '\' escapes (#199185)](https://github.com/elastic/kibana/pull/199185) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) \n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Bryce Buchanan <75274611+bryce-b@users.noreply.github.com>"}}]}] BACKPORT--> Co-authored-by: Larry Gregory --- .../metrics_explorer/components/helpers/create_tsvb_link.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts b/x-pack/plugins/observability_solution/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts index e07011b6ebc62..e41d191549c5a 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts @@ -114,7 +114,7 @@ export const createFilterFromOptions = ( filters.push(options.filterQuery); } if (options.groupBy) { - const id = series.id.replace('"', '\\"'); + const id = series.id.replace(/\\/g, '\\\\').replace(/"/g, '\\"'); const groupByFilters = Array.isArray(options.groupBy) ? options.groupBy .map((field, index) => {