Skip to content

Commit 88c98af

Browse files
committed
Add tag _sipparsefailure and log error instead of raising exception to logstash
1 parent dce6665 commit 88c98af

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/logstash/filters/sip.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ def filter(event)
170170
when String
171171
begin
172172
parse(value, fields)
173-
rescue
174-
@logger.error("Failed to parse SIP message", :value => value)
175-
raise
173+
rescue => e
174+
event.tag("_sipparsefailure")
175+
@logger.error("Failed to parse SIP message (#{e.backtrace.first}: #{e.message} / #{e.class})", :value => value)
176176
end
177177
else
178+
event.tag("_sipparsefailure")
178179
@logger.warn("SIP filter has no support for this type of data", :type => value.class, :value => value)
179180
end
180181

0 commit comments

Comments
 (0)