Automation Suite
2023.10
バナーの背景画像
EKS/AKS の Automation Suite のインストール ガイド
最終更新日 2024年4月19日

ロボット ログを Elasticsearch に保存する

Orchestrator は、既定でロボット ログをデータベースに保存するように設定されます。ただし、このストレージを Elasticsearch に切り替える場合、基本的な構成プロセスが用意されています。つまり、必要な URL、ユーザー名、パスワードを入力するだけです。ほとんどのユース ケースでは、この設定で十分です。さらにカスタマイズする場合は、基本設定に加えて高度な構成メカニズムを利用できます。

基本構成

この構成を選択する場合、ロボット ログをデータベースではなく Elasticsearch ターゲットに書き込むことを許可し、Orchestrator がログを Elasticsearch から取得するように設定します。

input.json ファイルを編集すると、ロボット ログを Elasticsearch サーバーに保存するように構成できます。

基本構成でサポートされるのは Elasticsearch バージョン 7.x です。Elasticsearch 8.x の場合は、高度な構成を使用する必要があります。

次の表に、orchestrator.orchestrator_robot_logs_elastic パラメーターのリストを示します。

パラメーター

説明

orchestrator_robot_logs_elastic

Elasticsearch セクションの構成です。プロパティ uriusernamepassword が含まれます。

elastic_uri

使用する Elasticsearch インスタンスのアドレスです。URI の形式で指定する必要があります。指定すると、ユーザー名とパスワードも必要になります。

elastic_auth_username

認証に使用される Elasticsearch のユーザー名です。

elastic_auth_password

認証に使用される Elasticsearch のパスワードです。

uipathctl インストーラーを介して構成を適用する

input.json を更新して、orchestratororchestrator_robot_logs_elastic セクションを追加します。
{
    ...
    "orchestrator": {
        ...
        "orchestrator_robot_logs_elastic": {
            "elastic_uri": "uri",
            "elastic_auth_username": "user",
            "elastic_auth_password": "pass"
        }
        ...
    }
    ...
}{
    ...
    "orchestrator": {
        ...
        "orchestrator_robot_logs_elastic": {
            "elastic_uri": "uri",
            "elastic_auth_username": "user",
            "elastic_auth_password": "pass"
        }
        ...
    }
    ...
}
uipathctl インストーラーを実行して構成を適用するには、次のコマンドを使用します。
uipathctl manifest apply input.json --only orchestrator --versions versions.jsonuipathctl manifest apply input.json --only orchestrator --versions versions.json

高度な設定

高度な構成設定にアクセスするには、まず基本構成を完了する必要があります。このプロセスでは、Elasticsearch と通信する NLog ターゲットのプロパティをカスタマイズできます。ただし、ロボット ログをリダイレクトするには追加の設定が必要です。これらの必要な調整は基本構成で行います。

重要:

次の手順に従って変更を加えると、システム全体の機能と安定性に悪影響を及ぼす可能性があります。変更を加えるのは、変更の影響を理解している場合だけにすることをお勧めします。

高度な構成では、NLog.config ターゲットを完全にカスタマイズできます。

  1. 基本構成の手順に従います。

  2. nlog.json のサンプル パラメーターを編集して、robotElasticBuffer のターゲットを目的の構成で更新します。nlog.json のサンプルについては、以下のセクションをご覧ください。
  3. nlog.json パラメーターを更新します。
    uipathctl config orchestrator update-config --nlog-config nlog.jsonuipathctl config orchestrator update-config --nlog-config nlog.json

nlog.json

Orchestrator には、ロボット ログ用の事前設定済みの NLog ターゲット (robotElasticBuffer) が含まれます。カスタムの nlog.json ファイルを使用して、このターゲットのプロパティを変更できます。ターゲット構成全体を指定する必要はありません。代わりに、目的の値のみを追加または更新します。

Elasticsearch 7.x の構成のサンプル

フィールド urirequireAuthusernamepassword は基本構成手順で設定済みなので、設定をスキップできます。
{
  "Nlog": {
    "targets": {
      "robotElasticBuffer": {
        "flushTimeout": 1000,
        "bufferSize": 1000,
        "slidingTimeout": false,
        "target": {
          "uri": "https://elastic.example.com:9200",
          "requireAuth": true,
          "username": "elastic-user",
          "password": "elastic-password",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "logEvent",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      }
    }
  }
}{
  "Nlog": {
    "targets": {
      "robotElasticBuffer": {
        "flushTimeout": 1000,
        "bufferSize": 1000,
        "slidingTimeout": false,
        "target": {
          "uri": "https://elastic.example.com:9200",
          "requireAuth": true,
          "username": "elastic-user",
          "password": "elastic-password",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "logEvent",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      }
    }
  }
}

Elasticsearch 8.x の構成のサンプル

フィールド urirequireAuthusernamepassword は基本構成手順で設定済みなので、設定をスキップできます。
{
  "Nlog": {
    "targets": {
      "robotElasticBuffer": {
        "flushTimeout": 1000,
        "bufferSize": 1000,
        "slidingTimeout": false,
        "target": {
          "uri": "https://elastic.example.com:9200",
          "requireAuth": true,
          "username": "elastic-user",
          "password": "elastic-password",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      }
    }
  }
}{
  "Nlog": {
    "targets": {
      "robotElasticBuffer": {
        "flushTimeout": 1000,
        "bufferSize": 1000,
        "slidingTimeout": false,
        "target": {
          "uri": "https://elastic.example.com:9200",
          "requireAuth": true,
          "username": "elastic-user",
          "password": "elastic-password",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      }
    }
  }
}

Orchestrator のカスタム構成を管理する

このセクションでは、Orchestrator にカスタム構成を指定する方法について説明します。

既存の構成シナリオが必要なユース ケースに対して十分ではない場合、別の方法、すなわち uipathctl config orchestrator で Orchestrator の構成を変更できます。

Orchestrator の設定

appsettings または NLog 用の Orchestrator の構成は複数の構成ファイルから読み込まれます。各構成ファイルは順々に読み込まれます。ファイルが新しく読み込まれるたびに、前のファイルのキーが上書きされます。ファイルの読み込み順序は次のとおりです。
  • Orchestrator イメージの組み込みの構成ファイル

  • orchestrator configmap
  • orchestrator シークレット
  • orchestrator-customconfig configmap
NLog 用の組み込み構成ファイルには、ロボット ログをデータベースに書き込むためのターゲットが含まれ、NLog ロボット ログ ルールを、このターゲットを使用するように設定します。組み込みの appsettings ファイルは、ロボット ログが表示に必要になったときにこのターゲットからロボット ログを読み取るように Orchestrator を設定します。NLog の組み込み構成ファイルには robotElasticBuffer ターゲットも含まれています。これは部分的に構成済みで、使用されません。
orchestrator 構成マップとシークレットは、Helm チャートを介して ArgoCD で管理されます。ArgoCD がアプリケーションを同期するたびに、orchestrator ArgoCD アプリケーションの現在のパラメーターと値を使用して、これらの構成が再生成されます。
基本構成で Elasticsearch を有効化すると、Argo のパラメーターが変更されて orchestrator 構成マップとシークレットが更新され、robotElasticBuffer を有効化するために必要な最終構成が提供されます。
高度な構成とは、orchestrator-customconfig 構成マップに上書きを追加することです。新規の値や変更された値はすべて既存の設定に結合されますが、値を削除することはできません (空に設定することはできますが、完全に削除することはできません)。

NLog の既定の設定

Orchestrator で NLog 用に提供されている既定の設定には、事前設定済みの robotElasticBuffer ターゲットが含まれています。
{
  "NLog": {
    "targets": {
      "robotElasticBuffer": {
        "type": "BufferingWrapper",
        "flushTimeout": 5000,
        "target": {
          "type": "ElasticSearch",
          "name": "robotElastic",
          "requireAuth": false,
          "uri": "",
          "username": "",
          "password": "",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "logEvent",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      },
    }
  }
}{
  "NLog": {
    "targets": {
      "robotElasticBuffer": {
        "type": "BufferingWrapper",
        "flushTimeout": 5000,
        "target": {
          "type": "ElasticSearch",
          "name": "robotElastic",
          "requireAuth": false,
          "uri": "",
          "username": "",
          "password": "",
          "index": "${event-properties:item=indexName}-${date:format=yyyy.MM}",
          "documentType": "logEvent",
          "includeAllProperties": true,
          "layout": "${message}",
          "excludedProperties": "agentSessionId,tenantId,indexName"
        }
      },
    }
  }
}

uipathctl を使用した Orchestrator のカスタム構成

Orchestrator のカスタム構成の更新に関する詳細情報を表示するには、次のコマンドを実行します。

uipathctl config orchestrator --helpuipathctl config orchestrator --help

出力:

Configure orchestrator custom config

Usage:
  uipathctl config orchestrator [command]

Available Commands:
  get-config    Get the current orchestrator custom config
  update-config Update orchestrator config

Flags:
  -h, --help   help for orchestrator

Global Flags:
      --context string      name of the kubeconfig context to use
      --kubeconfig string   kubectl configuration file (default: ~/.kube/config)
      --log-format string   log format. one of [text,json] (default "text")
      --log-level string    set log level. one of [trace,debug,info,error] (default "error")
  -q, --quiet               suppress all output except for errors and warnings
      --timeout duration    timeout of the command (default 1h0m0s)Configure orchestrator custom config

Usage:
  uipathctl config orchestrator [command]

Available Commands:
  get-config    Get the current orchestrator custom config
  update-config Update orchestrator config

Flags:
  -h, --help   help for orchestrator

Global Flags:
      --context string      name of the kubeconfig context to use
      --kubeconfig string   kubectl configuration file (default: ~/.kube/config)
      --log-format string   log format. one of [text,json] (default "text")
      --log-level string    set log level. one of [trace,debug,info,error] (default "error")
  -q, --quiet               suppress all output except for errors and warnings
      --timeout duration    timeout of the command (default 1h0m0s)
注: 高度な構成では Elasticsearch v8.x もサポートされます。

Was this page helpful?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
UiPath ロゴ (白)
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.