title: How to get output of the values that are not matched in filter function in Apache flink
body: <p>I am newbie to Apache flink i am trying to filter words that starts with letter "N" and i am getting output but how can i get words which don't starts with word "N" below is the code i am using</p>
  
  <pre><code>package DataStream;
  
  import org.apache.flink.api.common.functions.FilterFunction;
  import org.apache.flink.api.common.functions.FlatMapFunction;
  import org.apache.flink.api.java.tuple.Tuple2;
  import org.apache.flink.streaming.api.datastream.DataStream;
  import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
  import org.apache.flink.util.Collector;
  
  public class WordStream {
  
      public static void main(String[] args) throws Exception {
  
          final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
  
          DataStream&lt;String&gt; inputData = env.socketTextStream("localhost", 9999);
  
          DataStream&lt;String&gt; filterData = inputData.filter(new FilterFunction&lt;String&gt;() {
  
              /**
               * 
               */
              private static final long serialVersionUID = 1L;
  
              @Override
              public boolean filter(String value) throws Exception {
                  return value.startsWith("N");
              }
          });
  
          DataStream&lt;Tuple2&lt;String, Integer&gt;&gt; tokenize = filterData
                  .flatMap(new FlatMapFunction&lt;String, Tuple2&lt;String, Integer&gt;&gt;() {
  
                      @Override
                      public void flatMap(String value, Collector&lt;Tuple2&lt;String, Integer&gt;&gt; out) throws Exception {
                          out.collect(new Tuple2&lt;String, Integer&gt;(value, Integer.valueOf(1)));
  
                      }
                  });
  
          DataStream&lt;Tuple2&lt;String, Integer&gt;&gt; counts = tokenize.keyBy(0).sum(1);
  
          counts.print();
  
          env.execute("WordStream");
  
      }
  
  }
  </code></pre>
  
  <p>Can you suggest how to capture not matched words to another stream.</p>