Pipe pipe = new Pipe( "first" );
pipe = new Each( pipe, new Fields( "line" ), new RegexParser( new Fields( "ip" ), "^[^ ]*" ), new Fields( "ip" ) );
pipe = new GroupBy( pipe, new Fields( "ip" ) );
pipe = new Each( pipe, new Counter( TestEnum.FIRST ) );
pipe = new GroupBy( pipe, new Fields( "ip" ) );
pipe = new Each( pipe, new Counter( TestEnum.FIRST ) );
pipe = new Each( pipe, new Counter( TestEnum.SECOND ) );
Tap sink1 = getPlatform().getTextFile( getOutputPath( "flowstats1" ), SinkMode.REPLACE );
Tap sink2 = getPlatform().getTextFile( getOutputPath( "flowstats2" ), SinkMode.REPLACE );
Flow flow1 = getPlatform().getFlowConnector().connect( "stats1 test", source, sink1, pipe );