use of com.wavefront.agent.logsharvesting.LogsMessage in project java by wavefrontHQ.
the class RawLogsIngesterPortUnificationHandler method processLine.
@VisibleForTesting
@Override
public void processLine(final ChannelHandlerContext ctx, @Nonnull String message, @Nullable DataFormat format) {
received.inc();
ReportableEntityPreprocessor preprocessor = preprocessorSupplier == null ? null : preprocessorSupplier.get();
String processedMessage = preprocessor == null ? message : preprocessor.forPointLine().transform(message);
if (preprocessor != null && !preprocessor.forPointLine().filter(message, null))
return;
logsIngester.ingestLog(new LogsMessage() {
@Override
public String getLogLine() {
return processedMessage;
}
@Override
public String hostOrDefault(String fallbackHost) {
String hostname = hostnameResolver.apply(getRemoteAddress(ctx));
return StringUtils.isBlank(hostname) ? fallbackHost : hostname;
}
});
}
Aggregations