lib/fluent/plugin/out_google_cloud.rb
def compute_severity(resource_type, record, entry_level_common_labels)
      if resource_type == CLOUDFUNCTIONS_CONSTANTS[:resource_type]
        if @cloudfunctions_log_match && @cloudfunctions_log_match['severity']
          return parse_severity(@cloudfunctions_log_match['severity'])
        elsif record.key?('stream')
          return CLOUDFUNCTIONS_CONSTANTS[:stream_severity_map].fetch(
            record.delete('stream'), 'DEFAULT')
        end
      elsif record.key?('severity')
        return parse_severity(record.delete('severity'))
      elsif resource_type == GKE_CONSTANTS[:resource_type]
        stream = entry_level_common_labels["#{GKE_CONSTANTS[:service]}/stream"]
        return GKE_CONSTANTS[:stream_severity_map].fetch(stream, 'DEFAULT')
      end
      'DEFAULT'
    end
# Constants for service names, resource types and etc.
Constants for service names, resource types and etc.
Constants for service names resource types and etc .
def compute_severity(resource_type, record, entry_level_common_labels)
      if resource_type == CLOUDFUNCTIONS_CONSTANTS[:resource_type]
        if @cloudfunctions_log_match && @cloudfunctions_log_match['severity']
          return parse_severity(@cloudfunctions_log_match['severity'])
        elsif record.key?('stream')
          return CLOUDFUNCTIONS_CONSTANTS[:stream_severity_map].fetch(
            record.delete('stream'), 'DEFAULT')
        end
      elsif record.key?('severity')
        return parse_severity(record.delete('severity'))
      elsif resource_type == GKE_CONSTANTS[:resource_type]
        stream = entry_level_common_labels["#{GKE_CONSTANTS[:service]}/stream"]
        return GKE_CONSTANTS[:stream_severity_map].fetch(stream, 'DEFAULT')
      end
      'DEFAULT'
    end
def compute_severity ( resource_type , record , entry_level_common_labels ) if resource_type == CLOUDFUNCTIONS_CONSTANTS [ :resource_type ] if @cloudfunctions_log_match && @cloudfunctions_log_match [ 'severity' ] return parse_severity ( @cloudfunctions_log_match [ 'severity' ] ) elsif record . key? ( 'stream' ) return CLOUDFUNCTIONS_CONSTANTS [ :stream_severity_map ] . fetch ( record . delete ( 'stream' ) , 'DEFAULT' ) end elsif record . key? ( 'severity' ) return parse_severity ( record . delete ( 'severity' ) ) elsif resource_type == GKE_CONSTANTS [ :resource_type ] stream = entry_level_common_labels [ "#{GKE_CONSTANTS[:service]}/stream" ] return GKE_CONSTANTS [ :stream_severity_map ] . fetch ( stream , 'DEFAULT' ) end 'DEFAULT' end
Constants for service names, resource types and etc.
Constants for service names resource types and etc .
resource_type
record
entry_level_common_labels