lib/logstash/outputs/elasticsearch_groom.rb in logstash-output-elasticsearch_groom-0.1.1 vs lib/logstash/outputs/elasticsearch_groom.rb in logstash-output-elasticsearch_groom-0.1.2
- old
+ new
@@ -103,20 +103,20 @@
public
def receive(event)
return unless output?(event)
- ts_wildcarded = @index.gsub /%{\+.+}/, '*'
+ ts_wildcarded = @index.gsub /%{\+[^}]+}/, '*'
ts_wildcarded = event.sprintf ts_wildcarded
resolved_scope = event.sprintf(@scope)
return unless valid_option? 'scope', resolved_scope, %w(open closed both)
candidates = @es_access.matching_indices ts_wildcarded, resolved_scope
@logger.debug? and @logger.debug "Starting with #{candidates}"
groomed = []
- if (ts_bit_matched = @index.match /%{\+(.+)}/)
+ if (ts_bit_matched = @index.match /%{\+([^}]+)}/)
groomed = groom_by_time(event, candidates, ts_bit_matched)
else
@logger.warn "Only 'index' with a timestamp placeholder is supported. Instead had #{resolvedIndex}"
end