-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replay support for Enterprise event Search Filters (#18029)
* Backend: Add support for event search replay filters * Add missing license header * Fix forbidden API warning * fix: Add search-filters to the query --------- Co-authored-by: Ezequiel Lopez <[email protected]> Co-authored-by: Zack King <[email protected]>
- Loading branch information
1 parent
81e34a5
commit 4de08a2
Showing
4 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
graylog2-server/src/test/java/org/graylog/events/event/EventReplayInfoTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog.events.event; | ||
|
||
import org.joda.time.DateTime; | ||
import org.joda.time.DateTimeZone; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Collections; | ||
|
||
class EventReplayInfoTest { | ||
|
||
@Test | ||
public void testCreateNoFilters() { | ||
// Backwards-compatibility test for events that previously did not have filters. | ||
final DateTime now = DateTime.now(DateTimeZone.UTC); | ||
final EventReplayInfo info = EventReplayInfo.builder() | ||
.query("*") | ||
.streams(Collections.singleton("stream")) | ||
.timerangeStart(now.minusMinutes(1)) | ||
.timerangeEnd(now).build(); | ||
Assertions.assertNotNull(info.filters()); | ||
Assertions.assertTrue(info.filters().isEmpty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters