# 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) - `ca-path`: Path to CA certificate file (not yet implemented) !!!info When `_id` is defined on the index, it will be used as the document id when indexing. !!! ## Example !!!warning Even though this plugin is a sink, it will emit the response from the bulk index request downstream as an event. If not consuming those events, then it is important to declare the stage with `outputs: []`. Otherwise, LogBus will think this is a misconfigured dead-end. !!! ```yaml pipeline: write-opensearch: outputs: [] config: endpoint: !!js/function >- () => 'http://localhost:9200' index: !!js/function >- (event) => event._index ?? event.index ?? 'logbus' interval: 10 buffer: 1000 ssl: ca: ~/.certs/ca.pem ```