*
* http://open.spotify.com/track/2ZtQKBB8wDTtPPqDZhy7xZ
*
*/
final SyslogServerEventIF e;
if (STRUCTURED_SYSLOG_PATTERN.matcher(msg).matches()) {
e = new StructuredSyslogServerEvent(msg, remoteAddress);
} else {
e = new SyslogServerEvent(msg, remoteAddress);
}
final Message m = new Message(e.getMessage(), parseHost(e, remoteAddress), parseDate(e, receivedTimestamp));
m.addField("facility", Tools.syslogFacilityToReadable(e.getFacility()));
m.addField("level", e.getLevel());
// Store full message if configured.
if (configuration.getBoolean(CK_STORE_FULL_MESSAGE)) {
m.addField("full_message", new String(e.getRaw(), StandardCharsets.UTF_8));
}
final boolean expandStructuredData = configuration.getBoolean(CK_EXPAND_STRUCTURED_DATA);
m.addFields(parseAdditionalData(e, expandStructuredData));