diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts b/packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts index 7fce23b6fc966..54cbf585c9f25 100644 --- a/packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts +++ b/packages/elastic-apm-synthtrace/src/lib/utils/create_picker.ts @@ -8,7 +8,7 @@ export function createPicker(fields: string[]) { const wildcards = fields .filter((field) => field.endsWith('.*')) - .map((field) => field.replace('*', '')); + .map((field) => field.replace(/\*/g, '')); return (value: unknown, key: string) => { return fields.includes(key) || wildcards.some((field) => key.startsWith(field)); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts index 4c3551db3cbcd..ae492d344b3e6 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts +++ b/x-pack/plugins/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, '\\"'); const groupByFilters = Array.isArray(options.groupBy) ? options.groupBy .map((field, index) => {