Elasticsearch Destination
概要
Observability Pipelines の Elasticsearch Destination を使用して、ログやメトリクスを Elasticsearch に送信します。
セットアップ
シークレット管理の場合: Elasticsearch エンドポイント URL の識別子、ユーザー名、パスワードのみを入力します。実際の値は入力しないでください。
パイプラインをセットアップする際に、Elasticsearch 送信先を構成します。パイプラインは、UI、API、または Terraform を使用してセットアップできます。このセクションの手順は UI で構成されます。
パイプライン UI で Elasticsearch 送信先を選択したら、次のようにします。
- Elasticsearch のユーザー名とパスワードの識別子を入力してください。空白のままにすると、デフォルトが使用されます。
- ElasticSearch エンドポイント URL の識別子を入力します。空白のままにすると、デフォルトが使用されます。
- (オプション) Elasticsearch のバージョンを入力します。
- [Mode] (モード) ドロップダウンメニューで、[Bulk] (一括) または [Data stream] (データストリーム) を選択します。
- Bulkモード
- ElasticSearch の Bulk API を使用して、バッチ処理されたイベントを標準インデックスに直接送信します。
- インデックスの命名やライフサイクル管理を直接制御する場合に、このモードを選択します。データは指定したインデックスに追加されます。ロールオーバー、削除、マッピングの処理はユーザーが行う必要があります。
- [Bulk] モードを構成するには、次のようにします。
- (オプション) [Index] (インデックス) フィールドに、必要に応じて Elasticsearch インデックスの名前を入力します。テンプレート構文を使用すると、ログ内の特定のフィールドに基づいて異なるインデックスに動的にデータをルーティングできます (例:
logs-{{service}} or metrics-{{service}}.
- Data streams モード
- Uses Elasticsearch Data Streams for data storage. Data streams automatically manage backing indexes and rollovers, making them ideal for time series log data.
- Choose this mode when you want Elasticsearch to manage the index lifecycle for you. Data streams ensure smooth rollovers, Index Lifecycle Management (ILM) compatibility, and optimized handling of time-based data.
- To configure Data streams モードでは、オプションでデータストリーム名を指定したり、ルーティングと同期の設定を構成したりすることができます。
- In the Type (タイプ) フィールドに、取り込むデータのカテゴリーを入力します。例:
logs or metrics. - In the Dataset フィールドに、構造を記述する形式またはデータソースを指定します。例:
apache. - In the Namespace フィールドに、データストリームを分類するためのグループを入力します。例:
production. - Enable the Auto routing トグルを有効にすることにより、イベントの内容に基づいてイベントを自動的にデータストリームにルーティングします。
- Enable the Sync fieldsトグルを有効にすることによって、データストリームのフィールドを、Elasticsearch インデックスマッピングと同期させます。
- You can use template syntax for the Type] (タイプ)、[Dataset] (データセット)、および [Namespace] (名前空間) フィールドのための [テンプレート構文] を使用して、ログ内またはメトリクス内の特定のフィールドに基づいてデータストリーム名を動的に作成します。
- In the UI, there is a preview of the data stream name you configured. If the fields are left blank, the default data stream name used is
logs-generic-default for logs and metrics-generic-default for metrics. With the above example inputs, the data stream name that the Worker writes to is:logs-apache-production for logsmetrics-apache-production for metrics
If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with DD_OP_. For example, if you entered PASSWORD_1 for a password identifier, the environment variable for that password is DD_OP_PASSWORD_1.
オプション設定
TLS の有効化
スイッチを切り替えて、Enable TLS に設定します。
- シークレット管理を使用している場合: キーパスの識別子を入力します。フィールドを空白のままにした場合に使用されるデフォルトについては、シークレットのデフォルトを参照してください。
- TLS には、以下の証明書ファイルとキーファイルが必要です。
Server Certificate Path: DER または PEM (X.509) 形式の認証局 (CA) ルートファイルにより署名された証明書ファイルへのパス。CA Certificate Path: DER または PEM (X.509) 形式の認証局 (CA) ルートファイルである証明書ファイルへのパス。Private Key Path: DER または PEM (PKCS#8) 形式のサーバー証明書パスに属する .key 秘密鍵ファイルへのパス。- 注:
- 構成データディレクトリ
/var/lib/observability-pipelines-worker/config/ がファイルパスに自動的に追加されます。詳しくは、高度なワーカー構成 を参照してください。 - ファイルが
observability-pipelines-worker グループおよびユーザーから読み取り可能になっていなければなりません。
圧縮
Elasticsearch クラスターに大量のイベントを送信する場合は、圧縮を利用するとよいかもしれません。
スイッチを切り替えて Compression を有効にします。ドロップダウンメニューで、圧縮アルゴリズム (gzip、snappy、zlib、zstd) を選択します。デフォルトでは圧縮されません。
バッファリング
Toggle the switch to enable Buffering Options. Enable a configurable buffer on your destination to ensure intermittent latency or an outage at the destination doesn’t create immediate backpressure, and allow events to continue to be ingested from your source. Disk buffers can also increase pipeline durability by writing data to disk, ensuring buffered data persists through a Worker restart. See Destination buffers for more information.
- If left unconfigured, your destination uses a memory buffer with a capacity of 500 events.
- To configure a buffer on your destination:
- Select the buffer type you want to set (Memory or Disk).
- Enter the buffer size and select the unit.
- Maximum memory buffer size is 128 GB.
- Maximum disk buffer size is 5 TB.
- Note: For Worker versions 2.20.x and older, the maximum disk buffer size is 500 GB.
- In the Behavior on full buffer dropdown menu, select whether you want to block events or drop new events when the buffer is full.
高度なオプション
- ID Key (ID キー) フィールドに、Elasticsearch でドキュメント ID として使用するフィールドの名前を入力します。
- Pipeline (パイプライン) フィールドに、インデックス作成前にイベントに適用する Elasticsearch 取り込みパイプラインの名前を入力します。
- Retry partial failures (部分的失敗を再試行) のスイッチを有効にすると、バッチ内のイベントの一部が成功、一部が失敗という場合に、失敗した一括リクエストが再試行されます。
シークレットのデフォルト
These are the defaults used for secret identifiers and environment variables.
- Elasticsearch エンドポイント URL の識別子:
- デフォルトの識別子は
DESTINATION_ELASTICSEARCH_ENDPOINT_URL です。
- Elasticsearch 認証ユーザー名の識別子:
- デフォルトの識別子は
DESTINATION_ELASTICSEARCH_USERNAME です。
- Elasticsearch 認証パスワードの識別子:
- デフォルトの識別子は
DESTINATION_ELASTICSEARCH_PASSWORD です。
- Elasticsearch authentication username:
- The default environment variable is
DD_OP_DESTINATION_ELASTICSEARCH_USERNAME.
- Elasticsearch authentication password:
- The default environment variable is
DD_OP_DESTINATION_ELASTICSEARCH_PASSWORD.
- Elasticsearch endpoint URL:
- The default environment variable is
DD_OP_DESTINATION_ELASTICSEARCH_ENDPOINT_URL.
送信先の動作
イベントのバッチ処理
イベントのバッチは、次のパラメーターのいずれかが満たされたときにフラッシュされます。詳細については、送信先のイベントのバッチ処理 を参照してください。
| 最大イベント数 | 最大サイズ (MB) | タイムアウト (秒) |
|---|
| なし | 10 | 1 |