# write-opensearch

Buffer events until buffer or interval seconds and then ship them to endpoint() in index() using the /_bulk API.

# Config

Required:

  • index: Function that returns the index name (async not supported)

Optional:

  • endpoint: Function that returns server endpoint (default: http://localhost:9200)
  • buffer: Number of events to buffer before shipping (default: 1000)
  • interval: Number of seconds between shipments (default: 60)
  • caPath: Path to CA certificate file

# Example

pipeline:
  write-opensearch:
    outputs: []
    config:
      interval: 10
      buffer: 1000
      endpoint: !!js/function >-
        function() {
          return 'http://localhost:9200'
        }
      index: !!js/function >-
        function(event) {
          return event._index || event.index || 'logbus'
        }
      ssl:
        ca: ~/.certs/ca.pem