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

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

ロボット ログを Elasticsearch サーバーに保存する場合、基本構成と高度な構成の 2 種類の構成を使用できます。

基本構成では既定の機能が提供され、事前設定済みの Elasticsearch NLog ターゲットがアクティブ化されます。ターゲットは、バッファリング ターゲットにラップされた Elasticsearch ターゲットで構成されます。ほとんどのシナリオでは、この種類の構成で十分です。

ただし、ルールをさらにカスタマイズする必要がある場合は、高度な構成による方法を使用できます。

メモ: ロボット ログを Elasticsearch サーバーに保存するオプションは、一度構成した後にのみ有効となり、過去にさかのぼって適用されることはありません。 つまり、ログは単一の宛先からしか取得および表示できないため、オプションの構成時にデータベースに既に存在していたログにはアクセスできなくなります。

基本的なロボット ログ Elasticsearch の設定

基本設定を適用するには、以下の手順を実行します。詳細については、「Orchestrator のパラメーターを設定する」をご覧ください。

  1. 以下の例に示すように、構成ファイルで orchestrator_robot_logs_elastic という新しいセクションを Orchestrator の設定に追加します。
    "orchestrator": {
        "enabled": true,
        "orchestrator_robot_logs_elastic": {
            "elastic_uri": "https://elastic.example.com:9200",
            "elastic_auth_username": "elastic-user",
            "elastic_auth_password": "elastic-password"
        }
    }"orchestrator": {
        "enabled": true,
        "orchestrator_robot_logs_elastic": {
            "elastic_uri": "https://elastic.example.com:9200",
            "elastic_auth_username": "elastic-user",
            "elastic_auth_password": "elastic-password"
        }
    }
  2. 以下のパラメーターをユーザーが指定した値で更新します。

    パラメーター

    説明

    elastic_uri

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

    例: https://elastic.example.com:9200

    末尾にスラッシュを入れないようにしてください。

    elastic_auth_username例: elastic-user
    elastic_auth_password例: elastic-password

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

詳細なロボット ログ Elasticsearch の設定

重要: 次の手順に従って変更を加えると、システム全体の機能と安定性に悪影響を及ぼす可能性があります。変更を加えるのは、変更の影響を理解している場合だけにすることをお勧めします。
高度な構成では、NLog.config ターゲットを完全にカスタマイズできます。
  1. 上記の基本構成の手順に従います。
  2. NLog の高度な構成」手順に従い、変更が必要なプロパティで robotElasticBuffer ターゲットを更新します。
注:

高度な構成では Elasticsearch バージョン 8.x もサポートされます。

Elasticsearch 7.x のサンプル nlog.config.json
{
  "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 のサンプル nlog.config.json
{
  "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"
        }
      }
    }
  }
}

Was this page helpful?

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