Skip to content

Commit

Permalink
evaluating ruby contained in server_attribute strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Imron Alston committed Feb 14, 2018
1 parent fdb1f58 commit 4d4f210
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.2
0.8.3
16 changes: 16 additions & 0 deletions lib/fluent/plugin/out_scalyr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ def configure( conf )
end
end

#evaluate any statements in string value of the server_attributes object
if @server_attributes
new_attributes = {}
@server_attributes.each do |key, value|
if value.is_a?( String )
m = /^\#{(.*)}$/.match( value )
if m
new_attributes[key] = eval( m[1] )
else
new_attributes[key] = value
end
end
end
@server_attributes = new_attributes
end

@scalyr_server << '/' unless @scalyr_server.end_with?('/')

@add_events_uri = URI @scalyr_server + "addEvents"
Expand Down

0 comments on commit 4d4f210

Please sign in to comment.