在AEMaaCS中转发Splunk日志期间出现部署错误

配置Splunk日志转发时,由于端点使用不正确或网络配置错误,Adobe Experience Manager as a Cloud Service (AEMaaCS)中的部署失败。 管道在凭据审核验证期间引发以下错误:

配置类型“LogForwarding”中有错误: splunk的凭据审核作业失败:错误: splunk审核失败:对提供程序的请求由于意外的状态代码而失败: 500 (正文{"消息": "内部服务器错误"}),请检查凭据 | [凭据审核失败]

要解决此问题,请验证端点、令牌和网络配置设置。

描述 description

环境

  • 产品: Adobe Experience Manager as a Cloud Service (AEMaaCS) — 站点
  • 实例: 开发、暂存、生产

问题/症状

  • 由于端点不正确,部署管道在Splunk配置验证期间失败。
  • CURL命令已针对/services/collector进行测试,但AEM as a Cloud Service将日志转发到/services/collector/event,并需要来自该端点的​ 200 OK ​响应。
  • AEMaaCS在无法访问日志转发实例时会引发错误,通常是由于Splunk主机未使用开放端口(80/443)或未为自定义端口配置高级网络(ADVNET)。

解决方法 resolution

要解决此问题,请执行以下步骤:

  1. 验证logForwarding.yaml文件是否使用正确的Splunk HEC端点。 确保主机字段不包含/services/collector/event,因为它由管道自动添加。

  2. 使用以下curl命令测试与Splunk HEC端点的连接,并确认响应成功。

    code language-none
    curl -v https://<Splunk_HEC_Endpoint>/services/collector/event \            -H "Authorization: Splunk <Your_Token>" \            -d "{'event': 'Test event', 'sourcetype': 'manual', 'index': '<Your_Index>'}"
    
  3. 确保Splunk主机默认可在端口80或443上访问,如果使用其他端口,请启用高级网络(ADVNET)以允许该端口上的通信。

  4. 完成所有验证后,将以下配置添加到Git存储库中的/config/logForwarding.yaml文件。

    code language-none
    kind: "LogForwarding"    version: "1"    metadata:      envTypes: [ "dev"]     data:      splunk:        default:           enabled: true          host: "splunk-host.example.com" # DO NOT add /services/collector/event in the URL as it's added by Pipeline code          token: "${{SPLUNK_TOKEN}}" ## Cannot be set in the cofig: Error in config kind 'LogForwarding': while validating vendor config: [ token error]  value containing sensitive information cannot be stored in plain text`          index: "AEMaaCS"
    

    注意: 请确保主机值设置为splunk-host.example.com,而不包含http:// or https://前缀。

  5. 将更新的logForwarding.yaml文件提交到Git存储库中的/config/ directory

  6. 重新运行部署管道以应用更改。

  7. 通过检查Splunk实例中的AEMaaCS索引,验证日志是否成功转发。

相关阅读

AEMaaCS用户指南中的日志转发

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f