use of loghub.processors.ParseJson in project LogHub by fbacchella.
the class TestToJson method test1.
@Test
public void test1() throws ProcessorException {
Event e = Tools.getEvent();
Processor t = new ParseJson();
e.put("message", "{\"a\": [ 1, 2.0 , 3.01 , {\"b\": true} ] }");
e.process(t);
@SuppressWarnings("unchecked") Collection<Object> a = (Collection<Object>) e.get("a");
a.stream().forEach((i) -> logger.debug(i.getClass()));
logger.debug(e);
}
Aggregations