use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method failsWithLeadingHighlightQueryIfDisallowed.
@Test
public void failsWithLeadingHighlightQueryIfDisallowed() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().queryString(ElasticsearchQueryString.of("*a")).build();
assertThatExceptionOfType(ExportException.class).isThrownBy(() -> sut.run(command, chunk -> {
})).withCauseInstanceOf(ElasticsearchException.class);
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method usesQueryString.
@Test
public void usesQueryString() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().queryString(ElasticsearchQueryString.of("Ha Ho")).build();
runWithExpectedResultIgnoringSort(command, "timestamp,source,message", "graylog_0, 2015-01-01T04:00:00.000Z, source-2, Ho", "graylog_0, 2015-01-01T01:00:00.000Z, source-1, Ha");
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method usesProvidedTimeZone.
@Test
public void usesProvidedTimeZone() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().timeZone(// UTC+9:30
DateTimeZone.forID("Australia/Adelaide")).build();
runWithExpectedResult(command, "timestamp,source,message", "graylog_0, 2015-01-01T11:30:00.000+10:30, source-1, Ha", "graylog_1, 2015-01-01T12:29:59.999+10:30, source-2, He", "graylog_0, 2015-01-01T13:30:00.000+10:30, source-1, Hi", "graylog_0, 2015-01-01T14:30:00.000+10:30, source-2, Ho");
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method usesCorrectIndicesAndStreams.
@Test
public void usesCorrectIndicesAndStreams() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().streams(ImmutableSet.of("stream-01", "stream-02")).build();
mockIndexLookupFor(command, "graylog_0", "graylog_1");
runWithExpectedResultIgnoringSort(command, "timestamp,source,message", "graylog_0, 2015-01-01T01:00:00.000Z, source-1, Ha", "graylog_1, 2015-01-01T01:59:59.999Z, source-2, He", "graylog_0, 2015-01-01T04:00:00.000Z, source-2, Ho");
}
Aggregations