update regexp example & test

This commit is contained in:
Pete Fritchman 2010-12-03 22:52:17 -05:00
parent 0b23d59e87
commit 70ebef9c83
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ filters:
- nagios - nagios
- test - test
- match: - match:
message: r/foo.*bar/i message: (?i)foo.*bar
program: test program: test
add_fields: add_fields:
nagios_alert: foo_alert nagios_alert: foo_alert

View file

@ -67,7 +67,7 @@ class TestFilterGrep < Test::Unit::TestCase
def test_single_match_regexp def test_single_match_regexp
test_name "single_match_regexp" test_name "single_match_regexp"
config [{"match" => {"str" => /test.*foo/i}}] config [{"match" => {"str" => "(?i)test.*foo"}}]
event = LogStash::Event.new event = LogStash::Event.new
event.type = @typename event.type = @typename
@ -78,7 +78,7 @@ class TestFilterGrep < Test::Unit::TestCase
def test_single_match_regexp_drop def test_single_match_regexp_drop
test_name "single_match_regexp_drop" test_name "single_match_regexp_drop"
config [{"match" => {"str" => /test.*foo/}}] config [{"match" => {"str" => "test.*foo"}}]
event = LogStash::Event.new event = LogStash::Event.new
event.type = @typename event.type = @typename