community.general.sumologic 回调 – 将任务结果事件发送到 Sumologic

注意

此回调插件是 community.general 集合(版本 10.1.0)的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.general。您需要其他要求才能使用此回调插件,有关详细信息,请参见 要求

要在 playbook 中使用它,请指定:community.general.sumologic

回调插件

此插件是一个**通知回调**。它将 playbook 运行的信息发送到其他应用程序、服务或系统。有关回调插件的更多信息,请参阅 回调插件

概要

  • 此回调插件会将任务结果作为 JSON 格式的事件发送到 Sumologic HTTP 收集器源。

要求

在执行此回调的本地控制器节点上需要以下要求。

  • 将此回调插件列入白名单

  • 在 Sumologic 中创建一个 HTTP 收集器源,并指定自定义时间戳格式为 yyyy-MM-dd HH:mm:ss ZZZZ,自定义时间戳定位器为 "timestamp": "(.*)"

参数

参数

注释

url

字符串

Sumologic HTTP 收集器源的 URL。

配置

  • INI 条目

    [callback_sumologic]
    url = VALUE
    
  • 环境变量:SUMOLOGIC_URL

示例

examples: |
  To enable, add this to your ansible.cfg file in the defaults block
    [defaults]
    callback_whitelist = community.general.sumologic

  Set the environment variable
    export SUMOLOGIC_URL=https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/R8moSv1d8EW9LAUFZJ6dbxCFxwLH6kfCdcBfddlfxCbLuL-BN5twcTpMk__pYy_cDmp==

  Set the ansible.cfg variable in the callback_sumologic block
    [callback_sumologic]
    url = https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/R8moSv1d8EW9LAUFZJ6dbxCFxwLH6kfCdcBfddlfxCbLuL-BN5twcTpMk__pYy_cDmp==

作者

  • Ryan Currah (@ryancurrah)

提示

每种条目类型的配置条目都具有从低到高的优先级顺序。例如,列表中较低的变量将覆盖较高的变量。