http_response配置完毕后,http_response_result_code返回6

Viewed 160

http_response_response_code返回200,但报body mismatch,result_code返回6,这是为何,怎样修改可以让resulte_code为0

相关配置信息:
targets = [
"https://www.baidu.com",
"https://www.google.com"
]
method = "GET"

测试结果:

2023/09/26 10:20:30 http_response.go:304: E! body mismatch, response body: <html>
<head>
        <script>
▽               location.replace(location.href.replace("https://","http://"));
        </script>
</head>
<body>
        <noscript><meta http-equiv="refresh" content="0;url=http://www.baidu.com/"></noscript>
</body>
</html>
2023/09/26 10:20:30 http_response.go:309: E! status code mismatch, response stats code: 200

10:20:32 http_response_cert_expire_timestamp agent_hostname=mysql123 cert_name=baidu.com net=intranet product=mysql123 target=https://www.baidu.com 1722909065
10:20:32 http_response_response_time agent_hostname=mysql123 method=GET product=mysql123 target=https://www.baidu.com 0.077054876
10:20:32 http_response_result_code agent_hostname=mysql123 method=GET product=mysql123 target=https://www.baidu.com 6
10:20:32 http_response_response_code agent_hostname=mysql123 method=GET product=mysql123 target=https://www.baidu.com 200
2 Answers

v0.3.31没这个问题了,官网下载中心最新的还是0.3.30

对,官网还没同步

http_response_result_code 这个指标值为6的含义,目前版本应该是这样CodeMismatch ,不为0话都是探测失败

大佬,可以看下代码,配置文件应该也有注释解释,我看觉得这里,5应该是expect_response_substring这个参数配置不符合:)

我这里配置的是www.baidu.com。我的理解返回应该是0,在插件服务器上是可以访问百度的。categraf测试命令却输出了E! body mismatch, response body和E! status code mismatch, response stats code: 200,不理解为什么。

我猜应该是插件配置主动配置了expect_response_status_code