use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase 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 ElasticsearchExportBackendITBase method marksFirstChunk.
@Test
public void marksFirstChunk() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().build();
SimpleMessageChunk[] chunks = collectChunksFor(command).toArray(new SimpleMessageChunk[0]);
assertThat(chunks[0].isFirstChunk()).isTrue();
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method respectsResultLimitIfSet.
@Test
public void respectsResultLimitIfSet() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().chunkSize(1).limit(3).build();
SimpleMessageChunk totalResult = collectTotalResult(command);
assertThat(totalResult.messages()).hasSize(3);
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendSearchAfterIT method sortsByTimestampAscending.
@Test
public void sortsByTimestampAscending() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().build();
runWithExpectedResult(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-01T03:00:00.000Z, source-1, Hi", "graylog_0, 2015-01-01T04:00:00.000Z, source-2, Ho");
}
use of org.graylog.plugins.views.search.export.ExportMessagesCommand in project graylog2-server by Graylog2.
the class SearchAfterTest method usesIDAsTieBreakerForEventStreams.
@Test
void usesIDAsTieBreakerForEventStreams() {
ExportMessagesCommand command = ExportMessagesCommand.withDefaults().toBuilder().streams(DEFAULT_EVENT_STREAM_IDS.asList().get(0)).build();
sut.nextChunk(new Search.Builder(""), command);
List<String> sortKeys = captureSortKeys();
assertThat(sortKeys).containsExactly(FIELD_TIMESTAMP, EVENTS_TIEBREAKER_FIELD);
}
Aggregations