lib/fluent/plugin/out_google_cloud.rb
# 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 log_name(tag, resource)
      if resource.type == CLOUDFUNCTIONS_CONSTANTS[:resource_type]
        tag = 'cloud-functions'
      elsif resource.type == APPENGINE_CONSTANTS[:resource_type]
        tag = "#{APPENGINE_CONSTANTS[:service]}/#{tag}"
      elsif resource.type == GKE_CONSTANTS[:resource_type]
        if resource.labels && resource.labels.key?('container_name')
          sanitized_tag = sanitize_tag(resource.labels['container_name'])
          tag = sanitized_tag unless sanitized_tag.nil?
        end
      end
      tag = ERB::Util.url_encode(tag)
      tag
    end
def log_name ( tag , resource ) if resource . type == CLOUDFUNCTIONS_CONSTANTS [ :resource_type ] tag = 'cloud-functions' elsif resource . type == APPENGINE_CONSTANTS [ :resource_type ] tag = "#{APPENGINE_CONSTANTS[:service]}/#{tag}" elsif resource . type == GKE_CONSTANTS [ :resource_type ] if resource . labels && resource . labels . key? ( 'container_name' ) sanitized_tag = sanitize_tag ( resource . labels [ 'container_name' ] ) tag = sanitized_tag unless sanitized_tag . nil? end end tag = ERB :: Util . url_encode ( tag ) tag end
Constants for service names, resource types and etc.
Constants for service names resource types and etc .
# Add a prefix to Managed VM logs to prevent namespace collisions. # For Kubernetes logs, use just the container name as the log name # if we have it.
tag
resource