

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 從 Security Lake 刪除自訂來源
<a name="delete-custom-source"></a>

刪除自訂來源以停止將資料從來源傳送至 Security Lake。當您移除來源時，Security Lake 會停止從指定區域和帳戶中的來源收集資料，而且訂閱者無法再從來源取用新資料。不過，訂閱者仍然可以使用 Security Lake 在移除之前從來源收集的資料。您只能使用這些指示來移除自訂來源。如需移除原生支援的資訊 AWS 服務，請參閱 [在 Security Lake AWS 服務 中從 收集資料](custom-sources.md)。

在 Security Lake 中刪除自訂來源時，您必須使用來源停用 Security Lake 主控台外部的每個來源。未停用整合可能會導致來源整合繼續將日誌傳送至 Amazon S3。

------
#### [ Console ]

1. 在 https：//[https://console.aws.amazon.com/securitylake/](https://console.aws.amazon.com/securitylake/) 開啟 Security Lake 主控台。

1. 使用頁面右上角的 AWS 區域 選取器，選取要從中移除自訂來源的區域。

1. 在導覽窗格中，選擇**自訂來源**。

1. 選取您要移除的自訂來源。

1. 選擇**取消註冊自訂來源**，然後選擇**刪除**以確認動作。

------
#### [ API ]

若要以程式設計方式刪除自訂來源，請使用 Security Lake API 的 [DeleteCustomLogSource](https://docs.aws.amazon.com/security-lake/latest/APIReference/API_DeleteCustomLogSource.html) 操作。如果您使用的是 AWS Command Line Interface (AWS CLI)，請執行 [delete-custom-log-source](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/securitylake/delete-custom-log-source.html) 命令。在 AWS 區域 您想要刪除自訂來源的 中使用 操作。

在您的請求中，使用 `sourceName` 參數來指定要刪除的自訂來源名稱。或者指定自訂來源的名稱，並使用 `sourceVersion` 參數將刪除範圍限制為僅來自自訂來源的特定資料版本。

下列範例會從 Security Lake 刪除自訂日誌來源。

此範例已針對 Linux、macOS 或 Unix 格式化，並使用反斜線 (\\) 行接續字元來改善可讀性。

```
$ aws securitylake delete-custom-log-source \
--source-name {{EXAMPLE_CUSTOM_SOURCE}}
```

------