diff --git a/web/src/plugins/logs/Index.vue b/web/src/plugins/logs/Index.vue index 6d20a470f..c93aa895b 100644 --- a/web/src/plugins/logs/Index.vue +++ b/web/src/plugins/logs/Index.vue @@ -880,11 +880,12 @@ export default defineComponent({ return data.filter((item: any) => { if (item.expr) { if ( - (item.expr.type === "column_ref" && - item.expr?.column?.expr?.value === fieldName || item.expr.column === fieldName) || - (item.expr.type === "aggr_func" && - item.expr?.args?.expr?.column?.value === fieldName) - ) { + (item.expr.type === "column_ref" && + (item.expr?.column?.expr?.value === fieldName || item.expr.column === fieldName) + ) || + (item.expr.type === "aggr_func" && + item.expr?.args?.expr?.column?.value === fieldName) + ) { return false; } } @@ -939,12 +940,12 @@ export default defineComponent({ type: "expr", }); } - + const streamName = searchObj.data.stream.selectedStream[0].replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const newQuery = parser .sqlify(parsedSQL) .replace(/`/g, "") .replace( - new RegExp(`\\b${searchObj.data.stream.selectedStream[0]}\\b`, 'g'), // Wrap only standalone 'default' + new RegExp(`\\b${streamName}\\b`, 'g'), // Wrap only standalone stream name `"${searchObj.data.stream.selectedStream[0]}"` ); searchObj.data.query = newQuery;