<NME> test_event.rb
<BEF> ADDFILE
<MSG> - Add LogStash::Event.sprintf(str)
  Takes a string. Replaces ${foo} with the event[foo] value. If no
  value, does not replace it.
- Allow grep to add_tags and add_fields with values from the event.
  Useful for adding tags/fields for nagios alerts and other such
  goodness.
- Add tests for grep add_{fields,tags} with a format string as above.
- Add some TODOs for possible confusion cleanup needed.

<DFF> @@ -0,0 +1,26 @@
+require "rubygems"
+$:.unshift File.dirname(__FILE__) + "/../../lib"
+$:.unshift File.dirname(__FILE__) + "/../"
+
+require "test/unit"
+require "logstash"
+require "logstash/event"
+
+class TestEvent < Test::Unit::TestCase
+  def test_name(name)
+    @typename = name
+  end
+
+  def test_sprintf
+    test_name "sprintf"
+    event = LogStash::Event.new
+    event.type = @typename
+    event.message = "hello world"
+    event.source = "/home/foo"
+    event["test"] = "test"
+
+    ["@type", "@message", "@source", "test"].each do |name|
+      assert_equal(event[name], event.sprintf("${#{name}}"))
+    end
+  end # def test_single_match
+end # TestEvent

- Add LogStash::Event.sprintf(str)   Takes a string. Replaces ${foo} with the event[foo] value. If no   value, does not replace it. - Allow grep to add_tags and add_fields with values from the event.   Useful for adding tags/fields for nagios alerts and other such   goodness. - Add tests for grep add_{fields,tags} with a format string as above. - Add some TODOs for possible confusion cleanup needed.