Class: Fluent::TextParser::SentryHttpParser
- Inherits:
-
Parser
- Object
- Parser
- Fluent::TextParser::SentryHttpParser
- Defined in:
- lib/fluent/plugin/parser_sentry_http.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ SentryHttpParser
constructor
A new instance of SentryHttpParser.
- #parse(text) ⇒ Object
Constructor Details
#initialize ⇒ SentryHttpParser
Returns a new instance of SentryHttpParser.
13 14 15 |
# File 'lib/fluent/plugin/parser_sentry_http.rb', line 13 def initialize super end |
Instance Method Details
#configure(conf) ⇒ Object
17 18 19 |
# File 'lib/fluent/plugin/parser_sentry_http.rb', line 17 def configure(conf) super end |
#parse(text) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fluent/plugin/parser_sentry_http.rb', line 21 def parse(text) = Zlib::Inflate.inflate(Base64.decode64(text)) record = Oj.load(, :mode => :compat) record_time = record['timestamp'] time = record_time.nil? ? Engine.now : Time.parse(record_time).to_i record = {@field_name => } unless @json_parse yield time, record rescue => e $log.warn "parse error: #{e.message}" yield nil, nil end |