LoginSignup
1
0

Fivetranと外部ログサービス(Azure LogAnaytics)を連携する方法について

Last updated at Posted at 2024-03-02

Fivetranでログ管理する方法をまとめました。

ログ管理するにはDestinationで外部ログサービスと連携する必要があります。

今回はログサービスにAzureを使います。
まずAzureでLog Analyticsワークスペースを作成しましょう。

スクリーンショット 2024-03-02 22.16.23.png

Bashスクリプトを作成しました。

# Fivetran APIキーに置き換える
API_KEY=$FIVETRAN_API_KEY
API_SECRET_KEY=$FIVETRAN_API_SECRET_KEY

# APIエンドポイント
URL="https://api.fivetran.com/v1/external-logging"

# リクエストボディ
BODY='{
  "group_id": "herring_idealness",
  "service": "azure_monitor_log",
  "enable": true,
  "config": {
    "workspace_id": "17aff66f-0d28-4253-b303-91af9a2ee91e",
    "primary_key": "xxxxxxxxxxxxxxxx"
  }
}'

# APIリクエストの実行
curl -X POST "$URL" \
     -u "$API_KEY:$API_SECRET_KEY" \
     -H "Content-Type: application/json" \
     -d "$BODY" | jq

workspace_idとprimary_keyはLog Analyticsワークスペースのエージェントから確認できます。

スクリーンショット 2024-03-02 22.23.06.png

またgroup_idについてはDestinationで確認できます。
詳しい確認方法はFivetranとSnowflakeをAPI連携する方法について
で紹介しています。

実行結果

~# ./post-external-logging.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   513  100   236  100   277    215    253  0:00:01  0:00:01 --:--:--   468
{
  "code": "Success",
  "message": "External logging service has been added",
  ...

DestinationのExternal Loggingを確認するとAzureと連携されているのが分かりますね!

スクリーンショット 2024-03-02 23.46.40.png

以上でログを管理できるようになりました。

まとめ

Fivetranをログを管理するには外部サービスを使いましょう。
使用できるサービスはリファレンスに載っています。

詳しくはFivetranリファレンスを確認ください。
https://fivetran.com/docs/rest-api/log-service-management

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0