@@ -14,8 +14,6 @@ import { mockBrowserFields } from '../../../common/containers/source/mock';
14
14
import { EsQueryConfig , Filter , esFilters } from '../../../../../../../src/plugins/data/public' ;
15
15
16
16
const cleanUpKqlQuery = ( str : string ) => str . replace ( / \n / g, '' ) . replace ( / \s \s + / g, ' ' ) ;
17
- const startDate = '2018-03-23T18:49:23.132Z' ;
18
- const endDate = '2018-03-24T03:33:52.253Z' ;
19
17
20
18
describe ( 'Build KQL Query' , ( ) => {
21
19
test ( 'Build KQL query with one data provider' , ( ) => {
@@ -238,8 +236,6 @@ describe('Combined Queries', () => {
238
236
filters : [ ] ,
239
237
kqlQuery : { query : '' , language : 'kuery' } ,
240
238
kqlMode : 'search' ,
241
- start : startDate ,
242
- end : endDate ,
243
239
} )
244
240
) . toBeNull ( ) ;
245
241
} ) ;
@@ -255,8 +251,6 @@ describe('Combined Queries', () => {
255
251
filters : [ ] ,
256
252
kqlQuery : { query : '' , language : 'kuery' } ,
257
253
kqlMode : 'search' ,
258
- start : startDate ,
259
- end : endDate ,
260
254
isEventViewer,
261
255
} )
262
256
) . toEqual ( {
@@ -300,8 +294,6 @@ describe('Combined Queries', () => {
300
294
] ,
301
295
kqlQuery : { query : '' , language : 'kuery' } ,
302
296
kqlMode : 'search' ,
303
- start : startDate ,
304
- end : endDate ,
305
297
isEventViewer,
306
298
} )
307
299
) . toEqual ( {
@@ -320,8 +312,6 @@ describe('Combined Queries', () => {
320
312
filters : [ ] ,
321
313
kqlQuery : { query : '' , language : 'kuery' } ,
322
314
kqlMode : 'search' ,
323
- start : startDate ,
324
- end : endDate ,
325
315
} ) ! ;
326
316
expect ( filterQuery ) . toEqual (
327
317
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -340,8 +330,6 @@ describe('Combined Queries', () => {
340
330
filters : [ ] ,
341
331
kqlQuery : { query : '' , language : 'kuery' } ,
342
332
kqlMode : 'search' ,
343
- start : startDate ,
344
- end : endDate ,
345
333
} ) ! ;
346
334
expect ( filterQuery ) . toEqual (
347
335
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"range":{"@timestamp":{"gte":1521848183232,"lte":1521848183232}}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -360,8 +348,6 @@ describe('Combined Queries', () => {
360
348
filters : [ ] ,
361
349
kqlQuery : { query : '' , language : 'kuery' } ,
362
350
kqlMode : 'search' ,
363
- start : startDate ,
364
- end : endDate ,
365
351
} ) ! ;
366
352
expect ( filterQuery ) . toEqual (
367
353
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"range":{"@timestamp":{"gte":1521848183232,"lte":1521848183232}}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -380,8 +366,6 @@ describe('Combined Queries', () => {
380
366
filters : [ ] ,
381
367
kqlQuery : { query : '' , language : 'kuery' } ,
382
368
kqlMode : 'search' ,
383
- start : startDate ,
384
- end : endDate ,
385
369
} ) ! ;
386
370
expect ( filterQuery ) . toEqual (
387
371
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"match":{"event.end":1521848183232}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -400,8 +384,6 @@ describe('Combined Queries', () => {
400
384
filters : [ ] ,
401
385
kqlQuery : { query : '' , language : 'kuery' } ,
402
386
kqlMode : 'search' ,
403
- start : startDate ,
404
- end : endDate ,
405
387
} ) ! ;
406
388
expect ( filterQuery ) . toEqual (
407
389
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"match":{"event.end":1521848183232}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -417,8 +399,6 @@ describe('Combined Queries', () => {
417
399
filters : [ ] ,
418
400
kqlQuery : { query : 'host.name: "host-1"' , language : 'kuery' } ,
419
401
kqlMode : 'search' ,
420
- start : startDate ,
421
- end : endDate ,
422
402
} ) ! ;
423
403
expect ( filterQuery ) . toEqual (
424
404
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -435,8 +415,6 @@ describe('Combined Queries', () => {
435
415
filters : [ ] ,
436
416
kqlQuery : { query : 'host.name: "host-1"' , language : 'kuery' } ,
437
417
kqlMode : 'search' ,
438
- start : startDate ,
439
- end : endDate ,
440
418
} ) ! ;
441
419
expect ( filterQuery ) . toEqual (
442
420
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -453,8 +431,6 @@ describe('Combined Queries', () => {
453
431
filters : [ ] ,
454
432
kqlQuery : { query : 'host.name: "host-1"' , language : 'kuery' } ,
455
433
kqlMode : 'filter' ,
456
- start : startDate ,
457
- end : endDate ,
458
434
} ) ! ;
459
435
expect ( filterQuery ) . toEqual (
460
436
'{"bool":{"must":[],"filter":[{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}]}}],"should":[],"must_not":[]}}'
@@ -473,8 +449,6 @@ describe('Combined Queries', () => {
473
449
filters : [ ] ,
474
450
kqlQuery : { query : 'host.name: "host-1"' , language : 'kuery' } ,
475
451
kqlMode : 'search' ,
476
- start : startDate ,
477
- end : endDate ,
478
452
} ) ! ;
479
453
expect ( filterQuery ) . toEqual (
480
454
'{"bool":{"must":[],"filter":[{"bool":{"should":[{"bool":{"should":[{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 3"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 4"}}],"minimum_should_match":1}}]}}]}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 2"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 5"}}],"minimum_should_match":1}}]}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}'
@@ -493,8 +467,6 @@ describe('Combined Queries', () => {
493
467
filters : [ ] ,
494
468
kqlQuery : { query : 'host.name: "host-1"' , language : 'kuery' } ,
495
469
kqlMode : 'filter' ,
496
- start : startDate ,
497
- end : endDate ,
498
470
} ) ! ;
499
471
expect ( filterQuery ) . toEqual (
500
472
'{"bool":{"must":[],"filter":[{"bool":{"filter":[{"bool":{"should":[{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 3"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 4"}}],"minimum_should_match":1}}]}}]}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 2"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 5"}}],"minimum_should_match":1}}]}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}]}}],"should":[],"must_not":[]}}'
0 commit comments