We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dfd208 commit d943273Copy full SHA for d943273
lib/fluent/plugin/in_protobuf_http.rb
@@ -116,9 +116,10 @@ def get_msg_types(compiled_proto)
116
log.debug("Extracting message types [#{compiled_proto}]...")
117
msg_types = []
118
File.foreach(compiled_proto) do |line|
119
- if line.lstrip.start_with?('add_message')
120
- msg_type = line[/"([^"]*)"/, 1] # regex: <add_message> 'msg_type' <do>
121
- 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
122
+ msg_types.push(extracted_msg_type) unless extracted_msg_type.nil?
123
end
124
125
0 commit comments