lib/fluent/plugin/out_logentries.rb in fluent-plugin-logentries-0.2.1 vs lib/fluent/plugin/out_logentries.rb in fluent-plugin-logentries-0.2.2

- old
+ new

@@ -64,25 +64,24 @@ end end # Returns the correct token to use for a given tag / records def get_token(tag, record) - tag ||= "" - message = record["message"] + app_name = record["app_name"] || "" # Config Structure # ----------------------- # app-name: # app: TOKEN # access: TOKEN (optional) # error: TOKEN (optional) @tokens.each do |key, value| - if tag.index(key) != nil || message.index(key) != nil + if tag.index(key) != nil || app_name.index(key) != nil default = value['app'] case tag when @tag_access_log - return value['access'] || default + return value['access'] || default when @tag_error_log return value['error'] || default else return default