use of loghub.processors.Mapper in project LogHub by fbacchella.
the class TestFileMap method testone.
@Test
public void testone() throws ProcessorException {
URL ifpixurl = getClass().getResource("/ipfix-information-elements.csv");
FileMap s = new FileMap();
s.setMappingFile(ifpixurl.getFile());
s.setCsvFormat("RFC4180");
s.setKeyName("ElementID");
s.setValueName("Name");
s.configure(null);
Mapper p = new Mapper();
p.setField(new String[] { "type" });
p.setLvalue(new String[] { "type" });
p.setMap(s);
Event e = Tools.getEvent();
e.put("type", "1");
ProcessingStatus ps = Tools.runProcessing(e, "main", Collections.singletonList(p));
Event ep = ps.mainQueue.remove();
Assert.assertEquals("octetDeltaCount", ep.get("type"));
}
Aggregations