You can configure your M10+ Atlas clusters to export system logs every minute to an AWS S3 bucket.
この統合により、次のことが可能になります。
S3バケットにエクスポートするMongoDBログファイルを指定します。 Atlas は次のログタイプのエクスポートをサポートしています。
mongodmongosmongod-auditmongos-audit
最大 10 エクスポート パスを設定すると、複数のAWS S3 バケットにログを同時にエクスポートできます。
CRAP ARN との統合を構成して、S3マルチリージョン アクセス ポイント(CRAP)にログを送信します。現在、Atlas Administration APIを使用してのみ CRAP ARN を構成できます。 CRAP エイリアスはサポートされていません。
重要
ログには機密情報が含まれる場合があります( PII など)。 AWS S3バケット内のログのストレージと処理はユーザーがする必要があります。ログをエクスポートする前に Atlas が特定の情報をリダクションするには、 MongoDBサポート にお問い合わせください。
必要なアクセス権
AWS S3バケットにログをエクスポートするには、Atlas に対する Project Owner または Organization Owner アクセス権が必要です。
Considerations
各 Atlas ホストは通常、1 日あたり 1 GBのログを生成します。ログをエクスポートするには、 データ転送コストが発生します。具体的なデータ転送コストは、 宛先、リージョン、クラウドプロバイダーによって異なります。
ネットワークの問題または再試行により、 AWS S3バケットに重複するログエントリが発生する可能性があります。
AWS IAM ロールと S3バケットは同じAWSアカウントに属している必要があります。
前提条件
次のものが必要です。
sts:AssumeRole を持つAWS IAM ロール。これにより、Atlas はAWSリソースにアクセスでき、最大セッション期間は 12 時間に設定されます。
An existing AWS S3 bucket.
MongoDB 7.0 以降を実行中
M10+Atlas クラスター。
手順
AWS S3バケットにログをエクスポートするには、次の手順を実行します。
Atlas で、Project Settings ページに移動します。
まだ表示されていない場合は、希望するプロジェクトを含む組織を選択しますナビゲーション バーのOrganizationsメニュー
まだ表示されていない場合は、ナビゲーション バーのProjectsメニューから目的のプロジェクトを選択します。
サイドバーで、 アイコンを Project Overview の横にあるをクリックします。
[ Project Settings ]ページが表示されます。
Atlas に AWS アカウントへのアクセスを許可します。
Authorize an AWS IAM Role ドロップダウンから ARN を選択します。ARN を追加するには、「 統合AWSアクセスのセットアップ 」を参照してください。
[Next] をクリックします。
Atlas をAWS S3バケットに接続します。
Bucket Nameフィールドに、 AWSアカウントに表示される S3バケットの名前を入力します。
Prefixフィールドにディレクトリ名を入力して、 S3バケットの内容を整理します。例、
logs/と入力すると、エクスポートされたログを保存するための S3バケットにlogsディレクトリが作成されます。[Log Type で、エクスポートするログのタイプを選択します。
MongoDB Logs Diagnostic logs written by each
mongodserver process. They record server startup and shutdown, configuration, connections, slow queries, replication, sharding activity, and other operational events.MongoDB Audit Logs Auditing logs emitted by
mongodthat track system event actions such as authentication attempts, authorization checks, role changes, and other security-relevant operations. These logs are separate from the main MongoDB log.MongoDB Router Logs Diagnostic logs written by each
mongosrouter process in a sharded cluster. They capture router-specific behavior such as routing of queries to shards, sharding metadata refreshes, and general process diagnostics.MongoDB Router Audit Logs Auditing logs emitted by
mongosrouter processes, recording the same kinds of audited system events but from the router's perspective in a sharded deployment.
詳しくは、MongoDBログの表示とダウンロードを参照してください。
(任意) S3バケット内のログを暗号化する場合は、 KMS KeyフィールドにAWS KMS(Key Management Service)キー ARN を入力します。詳細については、 「 AWS KMS によるカスタマー キーの管理 」を参照してください。
[Next] をクリックします。
Assign an access policy to your AWS IAM role.
Click to copy the access policy generated by Atlas and save it locally with the file name:
AtlasS3LogExportPolicy.Click をクリックして Atlas によって生成された CLI コマンドをコピーし、ターミナルでコマンドを実行して、アクセス ポリシーをあなたの AWS IAM ロールにアタッチします。
エクスポートを有効にする前に、Validate をクリックして、構成と認証情報が正しいことを確認してください。
ログのエクスポート形式
Atlas は、 構造化メタデータを持つJSONオブジェクトとして S3バケットにログをエクスポートします。各ログエントリには、元のMongoDBログメッセージとソースクラスター、ホスト、およびログタイプを識別する追加のコンテキスト フィールドが含まれます。
エクスポートされたログは、レガシーの Push-Based Log Export (PBLE) システムとは異なる構造化された形式を使用します。この新しい形式により、ログインフラストラクチャ内でのログのルーティング、フィルター、分析のためのメタデータが強化されます。
ログエントリ構造
エクスポートされた各ログエントリは、次のトップレベルフィールドを持つ JSON オブジェクトです。
フィールド | 説明 |
|---|---|
| サービスの種類を識別する string。デフォルトは |
| JSON エンコードされた string としての元の MongoDB ログ メッセージ。これには、MongoDB からの構造化されたログ データが含まれています。これには、 |
| ログエントリを生成したMongoDBホストの完全修飾ドメイン名(例: |
| クラスターを含む Atlas プロジェクト ID(グループ ID とも呼ばれる)。 |
| Atlas が使用する内部クラスター識別子。 |
| Atlas UI に表示されるユーザー定義のクラスター名。 |
| エクスポートされるログの種類。指定できる値: |
| ログ エントリが生成された時の ISO 8601 タイムスタンプ。 |
ログエントリの例
次の例は、一般的なエクスポートされたログエントリを示しています。
{ "service.name": "mongodb", "log": "{\"t\":{\"$date\":\"2026-05-19T21:58:00.309+00:00\"},\"s\":\"I\",\"c\":\"NETWORK\",\"id\":6723804,\"ctx\":\"conn928\",\"msg\":\"Ingress TLS handshake complete\",\"attr\":{\"durationMillis\":26}}", "host.name": "atlas-cluster-shard-00-00.nzmz4k.mongodb.net", "mongodb.group.id": "682f18ee72a6a02c8182cab3", "mongodb.cluster.name": "atlas-cluster", "mongodb.customer.cluster.name": "Cluster0", "mongodb.log.type": "mongod", "timestamp": "2026-05-19T21:58:00.309Z" }
The log field contains the original MongoDB log message. When parsed, it reveals the standard MongoDB log message structure:
{ "t": {"$date": "2026-05-19T21:58:00.309+00:00"}, "s": "I", "c": "NETWORK", "id": 6723804, "ctx": "conn928", "msg": "Ingress TLS handshake complete", "attr": { "durationMillis": 26 } }
注意
attr オブジェクト内のフィールドの順序は、ログエントリによって異なり、レガシー PBLE 形式とは異なる場合があります。ログ解析ツールは、attr 内のフィールドの順序に依存する必要はありません。
プッシュベースのログ エクスポート(PBLE)からの変更
外部ログシンク形式には、レガシーの Push-Based Log Export (PBLE) システムからの変更が多く含まれています。
変更 | 説明 |
|---|---|
ネストされたログコンテンツ | MongoDB ログ メッセージは、トップ レベルではなく、JSON エンコードされた string として |
追加のメタデータ フィールド | 新しいトップレベルフィールドにより、ログソースに関するコンテキストが提供されます: |
ログエントリの順序 | S3 に表示されるログエントリの順序は PBLE と異なる場合があります。時間分析のためにログエントリの順序に依存しないでください。正確な時間ベースのプロセシングには、 |
属性フィールドの順序付け |
|
解析の検討事項
エクスポートされたログをプロセシングする場合:
2 段階の JSON パース: まず外部 JSON オブジェクトをパースしてメタデータ フィールドにアクセスし、次に
logフィールドを JSON としてパースして MongoDB ログ メッセージにアクセスします。フィールドの抽出:特定のMongoDBログフィールド(
msg、c、attrなど)を抽出するには、まずlogフィールドを解析します。タイムスタンプ処理: トップレベルの
timestampフィールドは ISO 8601 形式を使用しますが、logコンテンツ内のt.$dateフィールドは MongoDB の拡張 JSON 形式を使用する場合があります。どちらも同じ時間を表します。クラスター識別:
mongodb.customer.cluster.nameを使用して、Atlas UI に表示されるクラスター名でログをフィルターします。mongodb.cluster.nameフィールドには内部識別子が含まれています。
ログ エクスポート失敗のアラート
Atlas automatically notifies you when log exports fail or recover through default alerts that are enabled for all projects.
Default Alerts
次のアラートは、 外部ログ シンク を持つすべてのプロジェクトでデフォルトで有効になっています。
These alerts are informational, which means when the alert condition is met, Atlas immediately sends email notifications to all users with the Project Owner role and logs the alert to the Project Activity Feed. These alerts don't appear on the Open Alerts or Closed Alerts tabs of the Project Alerts page. You can customize the notification recipients and methods in the Project Alerts settings. To learn more about the informational alert lifecycle, see Alerts Workflow.
アクティビティ フィード イベント
In addition to alerts, Atlas logs the following informational events to the Project Activity Feed:
Log export has recovered. Queued logs are ready to resume sending.
Log export has recovered. Queued logs are now being sent.
All queued logs have been delivered to sink.
To view these events, see View Activity Feed.
For more information about configuring alert notifications, see Configure an Alert.