Skip to content

Commit

Permalink
Fix msg not found error. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazeem authored Sep 16, 2023
1 parent 3dfd208 commit d943273
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/fluent/plugin/in_protobuf_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ def get_msg_types(compiled_proto)
log.debug("Extracting message types [#{compiled_proto}]...")
msg_types = []
File.foreach(compiled_proto) do |line|
if line.lstrip.start_with?('add_message')
msg_type = line[/"([^"]*)"/, 1] # regex: <add_message> 'msg_type' <do>
msg_types.push(msg_type) unless msg_type.nil?
line.strip!
if line.include?('::Google::Protobuf::DescriptorPool.generated_pool.lookup') && line.end_with?('.msgclass')
extracted_msg_type = line[/"([^"]*)"/, 1].freeze
msg_types.push(extracted_msg_type) unless extracted_msg_type.nil?
end
end

Expand Down

0 comments on commit d943273

Please sign in to comment.