automation-suite
2.2510
true
OpenShift 上的 Automation Suite 安装指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
将机器人日志保存到 Elasticsearch
配置 Orchestrator,以将机器人日志保存到 Automation Suite 中的 Elasticsearch 服务器。
可以通过两种类型的配置将机器人日志保存到 Elasticsearch 服务器:基本配置和高级配置。
基本配置提供默认功能,用于激活预配置的 Elasticsearch NLog 目标,该目标由包装在缓冲目标中的 Elasticsearch 目标组成。 在大多数情况下,这种类型的配置就足够了。
但是,如果您需要进一步自定义规则,可以使用高级配置方法。
备注:
将机器人日志保存到 Elasticsearch 服务器的选项仅在配置后生效,并且不会追溯性应用。这意味着您将无法再访问在配置选项时数据库中已有的任何日志,因为只能从单个目标检索和显示日志。
基本机器人日志 Elasticsearch 配置
要应用基本配置,请执行以下步骤。有关详细信息,请参阅配置 Orchestrator 参数。
-
在配置文件中,将名为
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" } } -
使用您自己的值更新以下参数:
参数 描述 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目标。
- 请遵循前面描述的基本配置步骤。
- 遵循高级 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"
}
}
}
}
}