lib/logstash/plugin_mixins/elasticsearch/common.rb
# This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output.
This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output.
This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output .
def handle_dlq_status(message, action, status, response)
      if @dlq_writer
        event, action = action.event, [action[0], action[1], action[2]]
        @dlq_writer.write(event, "#{message} status: #{status}, action: #{action}, response: #{response}")
      else
        if dig_value(response, 'index', 'error', 'type') == 'invalid_index_name_exception'
          level = :error
        else
          level = :warn
        end
        @logger.send level, message, status: status, action: action, response: response
      end
    end
def handle_dlq_status ( message , action , status , response ) if @dlq_writer event , action = action . event , [ action [ 0 ] , action [ 1 ] , action [ 2 ] ] @dlq_writer . write ( event , "#{message} status: #{status}, action: #{action}, response: #{response}" ) else if dig_value ( response , 'index' , 'error' , 'type' ) == 'invalid_index_name_exception' level = :error else level = :warn end @logger . send level , message , status : status , action : action , response : response end end
This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output.
This module defines common methods that can be reused by alternate elasticsearch output plugins such as the elasticsearch_data_streams output .
# To support bwc, we check if DLQ exists. otherwise we log and drop event (previous behavior) # TODO: Change this to send a map with { :status => status, :action => action } in the future
message
action
status
response