You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"source=logs-* | where `@timestamp` >= '2025-01-01T00:00:00.000Z' and `@timestamp` <= '2025-01-01T01:00:00.000Z'"
218
218
);
219
219
});
220
+
221
+
it('preserves a comma-separated multi-source clause',()=>{
222
+
constq=buildBoundedPPL('source=logs-2026.04,logs-2026.05 | head 10',start,end);
223
+
expect(q.startsWith('source=logs-2026.04,logs-2026.05 | where `@timestamp`')).toBe(true);
224
+
expect(q).toContain('| head 10');
225
+
});
226
+
227
+
it("preserves the optional 'search' keyword in front of source=",()=>{
228
+
constq=buildBoundedPPL('search source=logs-* | head 10',start,end);
229
+
expect(q.startsWith('search source=logs-* | where `@timestamp`')).toBe(true);
230
+
expect(q).toContain('| head 10');
231
+
});
232
+
233
+
it('preserves whitespace around the source equals sign',()=>{
234
+
constq=buildBoundedPPL('source = logs-* | head 10',start,end);
235
+
expect(q.startsWith('source = logs-* | where `@timestamp`')).toBe(true);
236
+
expect(q).toContain('| head 10');
237
+
});
238
+
239
+
it('keeps the user time filter intact when one is already present (PPL ANDs them, both run before stats)',()=>{
240
+
constq=buildBoundedPPL(
241
+
"source=logs-* | where `@timestamp` >= '2024-12-31T00:00:00Z' | stats count() by service",
242
+
start,
243
+
end
244
+
);
245
+
expect(q).toBe(
246
+
"source=logs-* | where `@timestamp` >= '2025-01-01T00:00:00.000Z' and `@timestamp` <= '2025-01-01T01:00:00.000Z' | where `@timestamp` >= '2024-12-31T00:00:00Z' | stats count() by service"
0 commit comments