檢視次數:

生成一個 JWT 權杖以開始通過 HTTP 事件收集第三方日誌,並將日誌資料轉發到 TrendAI Vision One™ 進行分析和關聯或合規用途。

步驟

  1. 移至「Agentic SIEM & XDR」「Data Source and Log Management」「Third-party log repositories」
  2. 建立新的日誌存放庫或選擇現有的日誌存放庫。
  3. 「Log repository」面板上,前往「Collectors」標籤並點擊「Add collector」
    隨即顯示「Add collector」畫面。
  4. 選擇日誌來源的供應商、產品、日誌格式和日誌時區。
  5. 指定收集器名稱和說明。
  6. 選擇 HTTP 事件收集作為日誌引入方法,並複製適合的端點 URL 以用於您的第三方資料來源。
  7. 請點選「新增」。
  8. 「Generate JWT token」畫面上,選擇 JWT 權杖到期時間,然後點擊「Generate token」
    注意
    注意
    若要管理第三方日誌收集器的 JWT 令牌,請前往「Agentic SIEM & XDR」「Data Source and Log Management」「Data sources and retention」「Third-party log repositories」並點擊「Manage JWT tokens」
  9. 「Copy JWT token」畫面上,複製並保存令牌。
  10. 請點選「關閉」。
  11. 「Collectors」標籤的「Log repository」抽屜中,驗證您所建立的收集器下的信息(包括端點 URL)。
    注意
    注意
    您可以使用以下 API 規範來轉發日誌:
    • 標題:
      標頭
      /raw 的值
      /hec 的值
      說明
      Authorization
      Bearer <token>
      Splunk <token>
      Bearer <token>
      Splunk <token>
      必需。收集器創建期間生成的 JWT 令牌。
      Content-Type
      text/plain
      text/plain
      application/json
      application/x-ndjson
      必填。目前,/raw 端點僅接受純文字內容。/hec 端點接受純文字、jason 和 x-ndjson 內容。
      Content-Encoding
      gzip
      gzip
      可選。目前,兩個端點僅接受內容編碼為 gzip 的情況,而有效負載是 gzip 文件。
    • 請求主體:
      • 對於/raw端點:有效負載主體被視為文本流。每一行(由\n\r\n分隔)作為單獨的日誌條目被攝取。
      • 對於/hec端點:有效負載主體被視為單一 JSON 物件、陣列或 NDJSON(以換行符分隔)。
    • 範例:
      • 針對/raw端點:
        curl -X POST 'https://<api-fqdn>/ingest/api/v1/third_party_log/raw' \
          -H "Authorization: Bearer <TOKEN>" \
          -H "Content-Type: text/plain" \
          -d '<189>Feb 01 10:00:00 router-1 denied tcp src 10.0.0.1
        <189>Feb 01 10:00:01 router-2 permitted tcp src 10.0.0.2'
      • 針對 /hec 端點(發送 JSON 陣列日誌):
        curl -X POST 'https://<api-fqdn>/ingest/api/v1/third_party_log/hec' \
          -H "Authorization: Bearer <TOKEN>" \
          -H "Content-Type: text/plain" \
          -d '[{"timestamp": "2026-04-07T10:00:03Z", "msg": "json log line 1"},{"timestamp": "2026-04-07T10:00:05Z", "msg": "json log line 2"}]'
      • 對於/hec端點(發送堆疊的 JSON 日誌):
        curl -X POST 'https://<api-fqdn>/ingest/api/v1/third_party_log/hec' \
          -H "Authorization: Splunk <TOKEN>" \
          -H "Content-Type: application/json" \
          -d '{"timestamp": "2026-04-07T10:00:03Z", "msg": "json log line 1"}{"timestamp": "2026-04-07T10:00:05Z", "msg": "json log line 2"}'