测试连接器编辑

堆栈管理 > 连接器 中,您可以通过导航到连接器编辑弹出窗口的“测试”选项卡或单击“创建”弹出窗口上的“保存并测试”按钮来测试新创建的连接器

Rule management page with the errors banner

或者直接打开相应的连接器编辑弹出窗口

Rule management page with the errors banner
Five clauses define the condition to detect

[预览] 此功能处于技术预览阶段,可能会在未来版本中更改或删除。Elastic 将努力解决任何问题,但技术预览版中的功能不受官方 GA 功能支持 SLA 的约束。 使用 kbn-action 工具对连接器进行故障排除编辑

您可以通过 kbn-action 运行电子邮件操作。在本例中,它是 Elastic Stack 的云部署

$ npm -g install pmuellr/kbn-action

$ export KBN_URLBASE=https://elastic:<password>@<cloud-host>.us-east-1.aws.found.io:9243

$ kbn-action ls
[
    {
        "id": "a692dc89-15b9-4a3c-9e47-9fb6872e49ce",
        "actionTypeId": ".email",
        "name": "gmail",
        "config": {
            "from": "[email protected]",
            "host": "smtp.gmail.com",
            "port": 465,
            "secure": true,
            "service": null
        },
        "isPreconfigured": false,
        "isDeprecated": false,
        "referencedByCount": 0
    }
]

然后,您可以运行以下测试

$ kbn-action execute a692dc89-15b9-4a3c-9e47-9fb6872e49ce '{subject: "hallo", message: "hallo!", to:["[email protected]"]}'
{
    "status": "ok",
    "data": {
        "accepted": [
            "[email protected]"
        ],
        "rejected": [],
        "envelopeTime": 100,
        "messageTime": 955,
        "messageSize": 521,
        "response": "250 2.0.0 OK  1593144408 r5sm8625873qtc.20 - gsmtp",
        "envelope": {
            "from": "[email protected]",
            "to": [
                "[email protected]"
            ]
        },
        "messageId": "<[email protected]>"
    },
    "actionId": "a692dc89-15b9-4a3c-9e47-9fb6872e49ce"
}