use of org.graylog.plugins.pipelineprocessor.processors.listeners.NoopInterpreterListener in project graylog2-server by Graylog2.
the class PipelineProcessorMessageDecorator method apply.
@Override
public SearchResponse apply(SearchResponse searchResponse) {
final List<ResultMessageSummary> results = new ArrayList<>();
if (pipelines.isEmpty()) {
return searchResponse;
}
searchResponse.messages().forEach((inMessage) -> {
final Message message = new Message(inMessage.message());
final List<Message> additionalCreatedMessages = pipelineInterpreter.processForPipelines(message, pipelines, new NoopInterpreterListener(), pipelineStateUpdater.getLatestState());
results.add(ResultMessageSummary.create(inMessage.highlightRanges(), message.getFields(), inMessage.index()));
additionalCreatedMessages.forEach((additionalMessage) -> {
// TODO: pass proper highlight ranges. Need to rebuild them for new messages.
results.add(ResultMessageSummary.create(ImmutableMultimap.of(), additionalMessage.getFields(), "[created from decorator]"));
});
});
return searchResponse.toBuilder().messages(results).build();
}
Aggregations