EntriesFieldsDumper implements EventFilter { @Override public void filter(final FieldsMap fields) throws FormatException { if (fields instanceof Event) { final Event event = (Event) fields; final List<LogEntry> entries = event.getEntries(); if (entries != null && entries.size() > 0) { final LogEntry entry = entries.get(0); event.putAll(entry); if (excludeRaw && entry.containsKey(LogEntry.FIELD_RAW_CONTENT)) { event.remove(LogEntry.FIELD_RAW_CONTENT); } } if (deleteEntries) { event.remove(Event.FIELD_ENTRIES); } } }  @Override void filter(final FieldsMap fields); @Override void filterKnownFields(final LinkedHashMap<String, FieldBaseTypes> knownFields); boolean isDeleteEntries(); void setDeleteEntries(final boolean deleteEntries); boolean isExcludeRaw(); void setExcludeRaw(final boolean excludeRaw);  }
@Test public void testIgnoreForNonEvents() throws FormatException { final FieldsMap fields = new FieldsMap(); final LogEntry entry = new LogEntry(); entry.put("abc", 1); fields.put(Event.FIELD_ENTRIES, Collections.singletonList(entry)); filter.filter(fields); Assert.assertFalse(fields.containsKey("abc")); }