Class: LogStash::Outputs::ElasticWorkplaceSearch

Inherits:
Base
  • Object
show all
Includes:
PluginMixins::DeprecationLoggerSupport, PluginMixins::EnterpriseSearch::SSLConfigs
Defined in:
lib/logstash/outputs/elastic_workplace_search.rb

Constant Summary collapse

SOURCE_WITH_SPRINTF_REGEX =
/^.*%\{.+\}.*$/.freeze

Instance Method Summary collapse

Instance Method Details

#multi_receive(events) ⇒ Object



63
64
65
66
67
68
69
70
# File 'lib/logstash/outputs/elastic_workplace_search.rb', line 63

def multi_receive(events)
  # because Workplace Search has a limit of 100 documents per bulk
  events.each_slice(100) do |events|
    batch = format_batch(events)
    @logger.trace('Sending bulk to Workplace Search', :size => batch.size, :data => batch.inspect) if @logger.trace?
    index(batch)
  end
end

#registerObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/logstash/outputs/elastic_workplace_search.rb', line 47

def register
  log_message = "The Workplace Search product is deprecated and not supported from version 9 of the Elastic Stack. " +
    "The Elastic Workplace Search output plugin is deprecated and will only receive security updates and critical bug fixes. " +
    "Please migrate to the Elastic Connector for continued support. " +
    "For more details, please visit https://www.elastic.co/guide/en/search-ui/current/tutorials-elasticsearch.html"
  deprecation_logger.deprecated log_message

  @retry_disabled = false
  @client = LogStash::PluginMixins::EnterpriseSearch::WorkplaceSearch::Client.new(client_options, params: params)
  begin
    check_connection!
  rescue => e
    raise ::LogStash::ConfigurationError, "Failed to connect to Workplace Search. Error: #{e.message}"
  end
end