diff --git a/etc/logstash-grep.yaml b/etc/logstash-grep.yaml index f23208404..4574a55af 100644 --- a/etc/logstash-grep.yaml +++ b/etc/logstash-grep.yaml @@ -21,7 +21,7 @@ filters: - nagios - test - match: - message: r/foo.*bar/i + message: (?i)foo.*bar program: test add_fields: nagios_alert: foo_alert diff --git a/test/logstash/filters/test_grep.rb b/test/logstash/filters/test_grep.rb index c88b95590..8bd3abe09 100644 --- a/test/logstash/filters/test_grep.rb +++ b/test/logstash/filters/test_grep.rb @@ -67,7 +67,7 @@ class TestFilterGrep < Test::Unit::TestCase def test_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.type = @typename @@ -78,7 +78,7 @@ class TestFilterGrep < Test::Unit::TestCase def test_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.type = @typename