<NME> multiline.rb
<BEF> ADDFILE
<MSG> Merge branch 'new-config-parser'

This merge brings many many things:

* A new config parser with proper array, hash, and other value support.
* Experimental conditionals support is present.
* The 'agent2' rewrite of the agent is now the only agent.
* backwards compatibility to "old style hashes" in the config is supported
* the multiline filter has been replaced by a codec.

Test results on JRuby 1.7.4, rbx-head (2.0.0.rc1), MRI 1.9.3:

  % rvm 1.7.4,rbx-head,1.9.3 do bin/logstash rspec spec/filters/*.rb spec/codecs/*.rb

  Finished in 9.37 seconds
  217 examples, 0 failures

  Finished in 2.75 seconds
  182 examples, 0 failures

  Finished in 1.74 seconds
  182 examples, 0 failures

<DFF> @@ -0,0 +1,43 @@
+require "logstash/codecs/multiline"
+require "logstash/event"
+require "insist"
+
+describe LogStash::Codecs::Multiline do
+  context "#decode" do
+    it "should be able to handle multiline events with additional lines space-indented" do
+      codec = LogStash::Codecs::Multiline.new("pattern" => "^\\s", "what" => "previous")
+      lines = [ "hello world", "   second line", "another first line" ]
+      events = []
+      lines.each do |line|
+        codec.decode(line) do |event|
+          events << event
+        end
+      end
+      codec.flush { |e| events << e }
+      insist { events.size } == 2
+      insist { events[0]["message"] } == "hello world\n   second line"
+      insist { events[1]["message"] } == "another first line"
+    end
+
+    it "should allow grok patterns to be used" do
+      codec = LogStash::Codecs::Multiline.new(
+        "pattern" => "^%{NUMBER} %{TIME}",
+        "negate" => true,
+        "what" => "previous"
+      )
+
+      lines = [ "120913 12:04:33 first line", "second line", "third line" ]
+
+      events = []
+      lines.each do |line|
+        codec.decode(line) do |event|
+          events << event
+        end
+      end
+      codec.flush { |e| events << e }
+
+      insist { events.size } == 1
+      insist { events.first["message"] } == lines.join("\n")
+    end
+  end
+end

Merge branch 'new-config-parser'