UiPath Documentation
test-cloud
latest
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

Test Cloud 管理ガイド

ログをエクスポートする

注:

利用可能な機能は、使用するクラウド プラットフォームによって異なります。詳しくは、「 機能の提供状況」をご覧ください。

The new Audit experience (Unified logs) lets you export logs in CSV format using one of the following methods:

  • ユーザー インターフェイスの [エクスポート] オプション: 組織またはテナントの [監査ログ] セクションから [エクスポート] を選択します。
  • 監査ログ API: 監査ログ API を使用します。
  • UiPath カスタム スクリプト: UiPath が開発したスクリプトを実行して、UiPath の長期監査ログ ストアからログをエクスポートします。

スクリプトを使用してログをエクスポートする

If you are using the new Audit experience, you can use a dedicated script to export audit logs for any timeframe. This script export is available on all licensing plans, with a retention of up to five years for Enterprise plans and two years for all other plans.

このスクリプトは、次の場合に役立ちます。

  • Accessing the complete set of audit logs for compliance and investigation, beyond the 100,000-log limit of the UI export.
  • Automating periodic log archival.

前提条件

  • A Linux or WSL (Windows Subsystem for Linux) environment with the dos2unix, unzip, and jq tools installed. To install them, run:
    sudo apt install dos2unix unzip jq
    sudo apt install dos2unix unzip jq
    
  • A confidential external application in your organization with the PM.Audit.Read (application) scope assigned.
  • The external application's credentials:
    • アプリケーション ID (client_id)
    • アプリケーション シークレット (client_secret)

手順

  1. Save the following script to a .sh file:
    appId=$1
    appSecret=$2
    organizationNameOrId=$3
    fromDate=$4
    toDate=$5
    mode=${6:-s}
    cloud=${7:-cloud}
    
    if [[ $# -lt 5 ]]; then
      echo "Error: Not all required input parameters provided."
      echo "Usage: $0 <appId> <appSecret> <organizationNameOrId> <fromDate> <toDate> <mode>(optional: v for verbose, s for silent)"
      exit 1
    fi
    
    # Validate "fromDate" date format (MM/DD/YYYY)
    if ! date -d "$fromDate" &>/dev/null; then
      echo "Error: Invalid date format for 'fromDate'. Please use MM/DD/YYYY format."
      exit 1
    fi
    
    # Validate "to" date format (MM/DD/YYYY)
    if ! date -d "$toDate" &>/dev/null; then
      echo "Error: Invalid date format for 'toDate'. Please use MM/DD/YYYY format."
      exit 1
    fi
    
    echo $(date +"%Y-%m-%d %H:%M:%S.%3N") "Start Getting UiPath Token."
    response=$(curl --data-urlencode -X POST "https://${cloud}.uipath.com/${organizationNameOrId}/identity_/connect/token" -$mode \
                -d "grant_type=client_credentials" \
                -d "scope=PM.Audit.Read" \
                -d "client_id=$appId" \
                -d "client_secret=$appSecret" \
                -H "Content-Type: application/x-www-form-urlencoded")
    
    access_token=$(echo "$response" | jq -r '.access_token')
    
    if [[ "$access_token" == null ]]; then
      echo "Error: Access token is null or empty in the response. Please verify the appId and appSecret."
      exit 1
    fi
    
    base_dir=$(date +"%Y-%m-%d%H:%M:%S.%3N")
    echo $base_dir "Start Downloading UiPath Platform Audit logs."
    # Define the base URL
    base_url="https://${cloud}.uipath.com/${organizationNameOrId}/orgaudit_/api/query/downloadeventsfromlongtermstore"
    
    mkdir -p $base_dir
    # Iterate through time intervals
    current_date=$(date -u -d "$fromDate" +"%Y-%m-%dT%H:%M:%SZ")
    seconds_in_a_day=$((24*60*60))
    while [ "$(date -d "$current_date" +%s)" -le "$(date -d "$toDate" +%s)" ]; do
      next_date=$(date -u -d "$current_date + $(($seconds_in_a_day-1)) seconds" +"%Y-%m-%dT%H:%M:%SZ")
    
      # Construct the full URL with the current time interval
      formatted_current_date=$(date -u -d "$current_date" +"%Y-%m-%dT%H:%M:%SZ" | sed 's/\//%2F/g')
      formatted_current_date="${current_date}"
      formatted_next_date=$next_date | sed 's/\//%2F/g'
      formatted_next_date="${next_date}"
      full_url="$base_url?from=$formatted_current_date&to=$formatted_next_date"
    
      echo $full_url
    
      echo "Downloading UiPath Audit Log from $current_date to $next_date"
      curl -X GET "$full_url" -$mode \
           -H "Authorization: Bearer $access_token" \
           -o "${base_dir}/${current_date////-}_to_${next_date////-}.zip"  # Save the response to a file
    
      # Move to the next time interval
      current_date=$next_date
      one=1
      current_date=$(date -u -d "$current_date + $one seconds" +"%Y-%m-%dT%H:%M:%SZ")
    done
    
    for zip_file in "$base_dir"/*.zip; do
      zip_file_name="$(basename "$zip_file")"
      unzip -q "$zip_file" -d "$base_dir/auditlogs/"
      echo "Extracted ${zip_file_name%.*}"
      rm "$zip_file"
    done
    
    shopt -s nullglob
    for zip_file in "$base_dir/auditlogs"/*.zip; do
      zip_file_name="$(basename "$zip_file")"
      unzip -q "$zip_file" -d "$base_dir/auditlogs/${zip_file_name%.*}"
      for data_file in "$base_dir/auditlogs"/${zip_file_name%.*}/*.txt; do
        data_file_name="$(basename "$data_file")"
        mv "$data_file" "$base_dir/auditlogs/${data_file_name%.*}_${zip_file_name%.*}.txt"
        rm -r "$base_dir/auditlogs/${zip_file_name%.*}"
      done
      rm "$zip_file"
    done
    shopt -u nullglob
    
    echo $(date +"%Y-%m-%d %H:%M:%S.%3N") "Downloaded UiPath Platform Audit logs and saved them according to UTC date"
    appId=$1
    appSecret=$2
    organizationNameOrId=$3
    fromDate=$4
    toDate=$5
    mode=${6:-s}
    cloud=${7:-cloud}
    
    if [[ $# -lt 5 ]]; then
      echo "Error: Not all required input parameters provided."
      echo "Usage: $0 <appId> <appSecret> <organizationNameOrId> <fromDate> <toDate> <mode>(optional: v for verbose, s for silent)"
      exit 1
    fi
    
    # Validate "fromDate" date format (MM/DD/YYYY)
    if ! date -d "$fromDate" &>/dev/null; then
      echo "Error: Invalid date format for 'fromDate'. Please use MM/DD/YYYY format."
      exit 1
    fi
    
    # Validate "to" date format (MM/DD/YYYY)
    if ! date -d "$toDate" &>/dev/null; then
      echo "Error: Invalid date format for 'toDate'. Please use MM/DD/YYYY format."
      exit 1
    fi
    
    echo $(date +"%Y-%m-%d %H:%M:%S.%3N") "Start Getting UiPath Token."
    response=$(curl --data-urlencode -X POST "https://${cloud}.uipath.com/${organizationNameOrId}/identity_/connect/token" -$mode \
                -d "grant_type=client_credentials" \
                -d "scope=PM.Audit.Read" \
                -d "client_id=$appId" \
                -d "client_secret=$appSecret" \
                -H "Content-Type: application/x-www-form-urlencoded")
    
    access_token=$(echo "$response" | jq -r '.access_token')
    
    if [[ "$access_token" == null ]]; then
      echo "Error: Access token is null or empty in the response. Please verify the appId and appSecret."
      exit 1
    fi
    
    base_dir=$(date +"%Y-%m-%d%H:%M:%S.%3N")
    echo $base_dir "Start Downloading UiPath Platform Audit logs."
    # Define the base URL
    base_url="https://${cloud}.uipath.com/${organizationNameOrId}/orgaudit_/api/query/downloadeventsfromlongtermstore"
    
    mkdir -p $base_dir
    # Iterate through time intervals
    current_date=$(date -u -d "$fromDate" +"%Y-%m-%dT%H:%M:%SZ")
    seconds_in_a_day=$((24*60*60))
    while [ "$(date -d "$current_date" +%s)" -le "$(date -d "$toDate" +%s)" ]; do
      next_date=$(date -u -d "$current_date + $(($seconds_in_a_day-1)) seconds" +"%Y-%m-%dT%H:%M:%SZ")
    
      # Construct the full URL with the current time interval
      formatted_current_date=$(date -u -d "$current_date" +"%Y-%m-%dT%H:%M:%SZ" | sed 's/\//%2F/g')
      formatted_current_date="${current_date}"
      formatted_next_date=$next_date | sed 's/\//%2F/g'
      formatted_next_date="${next_date}"
      full_url="$base_url?from=$formatted_current_date&to=$formatted_next_date"
    
      echo $full_url
    
      echo "Downloading UiPath Audit Log from $current_date to $next_date"
      curl -X GET "$full_url" -$mode \
           -H "Authorization: Bearer $access_token" \
           -o "${base_dir}/${current_date////-}_to_${next_date////-}.zip"  # Save the response to a file
    
      # Move to the next time interval
      current_date=$next_date
      one=1
      current_date=$(date -u -d "$current_date + $one seconds" +"%Y-%m-%dT%H:%M:%SZ")
    done
    
    for zip_file in "$base_dir"/*.zip; do
      zip_file_name="$(basename "$zip_file")"
      unzip -q "$zip_file" -d "$base_dir/auditlogs/"
      echo "Extracted ${zip_file_name%.*}"
      rm "$zip_file"
    done
    
    shopt -s nullglob
    for zip_file in "$base_dir/auditlogs"/*.zip; do
      zip_file_name="$(basename "$zip_file")"
      unzip -q "$zip_file" -d "$base_dir/auditlogs/${zip_file_name%.*}"
      for data_file in "$base_dir/auditlogs"/${zip_file_name%.*}/*.txt; do
        data_file_name="$(basename "$data_file")"
        mv "$data_file" "$base_dir/auditlogs/${data_file_name%.*}_${zip_file_name%.*}.txt"
        rm -r "$base_dir/auditlogs/${zip_file_name%.*}"
      done
      rm "$zip_file"
    done
    shopt -u nullglob
    
    echo $(date +"%Y-%m-%d %H:%M:%S.%3N") "Downloaded UiPath Platform Audit logs and saved them according to UTC date"
    
  2. Convert the line endings:
    dos2unix <script-name>.sh
    dos2unix <script-name>.sh
    
  3. Make the script executable:
    chmod +x <script-name>.sh
    chmod +x <script-name>.sh
    
  4. ターミナルで必要な変数を設定します。
    client_id='<your-client-id>'
    client_secret='<your-client-secret>'
    org_name='<your-org-name>'
    start_date='MM/DD/YYYY'
    end_date='MM/DD/YYYY'
    client_id='<your-client-id>'
    client_secret='<your-client-secret>'
    org_name='<your-org-name>'
    start_date='MM/DD/YYYY'
    end_date='MM/DD/YYYY'
    
  5. ./<script-name>.sh $client_id $client_secret $org_name $start_date $end_date コマンドを使用してスクリプトを実行します。 たとえば、次のとおりです。
    client_id='<clientId>'
    client_secret='<clientsecret>'
    org_name='test_org'
    start_date='09/01/2025'
    end_date='10/01/2025'
    ./<script-name>.sh $client_id $client_secret $org_name $start_date $end_date v
    client_id='<clientId>'
    client_secret='<clientsecret>'
    org_name='test_org'
    start_date='09/01/2025'
    end_date='10/01/2025'
    ./<script-name>.sh $client_id $client_secret $org_name $start_date $end_date v
    

結果の

The script creates a timestamped directory in your current location and downloads the audit logs for each day in the requested interval as .zip files. It then extracts the contents into the <timestamp>/auditlogs/ subfolder as .txt files, each named after the UTC date range it covers.

ロボット ログのエクスポートを設定する

注:

利用可能な機能は、使用するクラウド プラットフォームによって異なります。詳しくは、「 機能の提供状況」をご覧ください。

Orchestrator サービスで生成されたロボット ログを Azure、AWS S3、Google Cloud Storage にエクスポートするには、下記の各プロバイダー固有の詳しい手順に従ってください。ログは、uipathrobotlogs コンテナー内の .csv ファイルに保存されます。エクスポートはテナントごとに行われるため、以下の作業をスムーズに行えます。

  • コンプライアンスや監査のために保持する必要のあるログの保存
  • お使いのレポート ツールや BI ツールでの、ログ出力の分析・視覚化
    注:

    ログのエクスポート ページを設定する場合、30 日分のログのバックフィルはサポートされません。

  1. UiPath アカウントにログインします。

  2. [管理] に移動し、左側のパネルでテナントを選択します。

  3. [サービス] を選択します。

  4. Orchestrator のカードで [ その他 ] アイコンを選択し、[ ログのエクスポートの設定] を選択します。

    [設定] パネルがウィンドウの右側に表示されます。

  5. [ロボット ログをカスタム ストレージに送信] のトグルを有効化します。

  6. 使用しているクラウド プラットフォームに応じて、続いて以下の手順を実行します。

    • Test Cloud:
      1. [ストレージの種類] ドロップダウンから、ログのエクスポート先のストレージ プロバイダーを選択します。次のオプションを使用できます。
        • Azure
        • AWS S3
        • Google Cloud Storage
        注:

        ログのエクスポート機能は AWS KMS をサポートしていません。

      2. プロバイダー固有の手順を実行すると、 .csv が生成されます。サンプルをダウンロード.csv
      3. ログは 1 時間ごとに配信されます。この時間間隔は変更できません。
    • Test Cloud (公共部門向け) および Test Cloud (専有型):
      • 続いて「Azure」のセクションに記載されている手順を実行します。

Azure

ヒント:

静的 IP を許可リストに設定し、ネットワークをどの外部 IP に対しても開かないようにすることができます。Azure Blob Storage で [設定] > [ネットワーク] > [パブリック アクセス] > [ファイアウォール] > [アドレス範囲] に移動して、静的 IP を追加します。すべての IP のリストについては、「ファイアウォールを設定する」をご覧ください。

次のストレージ オプションがサポートされています。

  • 標準ローカル冗長ストレージ (LRS)
  • Standard geo 冗長ストレージ (GRS)
  • 標準読み取りアクセス geo 冗長ストレージ (RA-GRS)
  • Standard ゾーン冗長ストレージ (ZRS)
  • プレミアム LRS

ストレージの種類について詳しくは、Azure の公式ドキュメント「Storage account overview」のページをご覧ください。

  1. [ストレージの種類] ドロップダウンから [Azure Storage アカウント] を選択します。

  2. [Azure BLOB 接続文字列] フィールドに Azure Portal から取得した BLOB 接続文字列を入力します。

  3. [コンテナー名] フィールドに、Azure で csv の保存に使用するコンテナーの名前を入力します。既定では uipathrobotlogs です。カスタム コンテナー名を入力します。その名前がまだ存在しない場合は、コンテナーにより自動的に作成されます。

  4. [保存] を選択します。ロボット ログのエクスポートが正常に設定されたことを知らせる通知が表示されます。

  5. Azure Portal の Blob ストレージ アカウントで以下の手順を実行します。

    • 左側のパネルの [設定] > [ネットワーク] を選択します。
    • [許可するアクセス元] > [すべてのネットワーク] を選択します。
    • [保存] を選択して変更を保存します。
  6. 1 時間以内に .csv ログ ファイルが BLOB ストレージに生成されます。.csv は、uipathrobotlogs コンテナー内のフォルダー階層 [tenant_key]/[year]/[month]/[day]/[hour]/output に生成されます。1 つのコンテナーに 1 つのテナントをマッピングすることをお勧めします。1 つのコンテナーに複数のテナントを接続すると、テナント キーでしかテナントを区別できないからです。

AWS S3

ヒント:

静的 IP を許可リストに設定し、ネットワークをどの外部 IP に対しても開かないようにすることができます。AWS S3 ユーザー ガイドの「Bucket policies for Amazon S3」のページの説明に従って、AWS S3 のアクセス ポリシーを使用して、aws:SourceIpリストに指定されていない限り、すべての要求を拒否します。すべての IP のリストについては、『Automation Cloud 管理ガイド』の「 ファイアウォールを設定する 」をご覧ください。

  1. [ストレージの種類] ドロップダウンから [AWS S3] を選択します。

  2. [バケット名] フィールドに、AWS で設定したバケットの名前を入力します。

    注:

    同じバケット名を複数の組織で共有することはできません。

  3. [リージョン名] フィールドに、ログをエクスポートするリージョンの名前を入力します。例: us-west-1

  4. プロンプトで表示される IAM ユーザーに、バケットに対するアクセス権 s3:PutObject および s3:DeleteObject を必ず付与してください。

Google Cloud Storage

  1. [ストレージの種類] ドロップダウンから [Google Cloud Storage] を選択します。

  2. [バケット名] フィールドに、Google Cloud Platform で設定したバケットの名前を入力します。

    注:

    同じバケット名を複数の組織で共有することはできません。

  3. 下の図のプロンプトの指示に従い、UiPath® サービス アカウントに適切なアクセス権を付与します。

    1. Google Cloud Platform で [ストレージ] > [ブラウザ] に移動します。
    2. 権限を編集するバケットを検索します。
    3. 縦三点リーダー ボタンを選択して、[バケットの権限を編集] を選択します。
    4. [メンバーを追加] を選択して、バケットへのアクセスに使用するサービス アカウントを入力します。
    5. ロールを選択するドロップダウンから [ストレージ オブジェクト管理者] を選択します。詳しくは、GCP ドキュメントの「 ID およびアクセス管理 」をご覧ください。

ログ エクスポート設定を削除する

  1. ログ エクスポート設定を削除するテナントを展開します。
  2. そのテナント内の Orchestrator サービスの [ログのエクスポートの設定] を選択します。[設定] パネルが右側に表示されます。
  3. [ロボット ログをカスタム ストレージに送信] のトグルを無効化します。
  4. [ 設定を削除 ] ウィンドウの [ 削除 ] を選択して確定します。設定が削除されます。

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得