Hi, I'm facing an issue where heartbeat 7.5 reports a different response code (500) value than cUrl (302) reports on the same target URL I believe the heartbeat can me mimicked through curl -Iv
.
Below the heartbeat configuration in monitor.d, the corresponding response doc and curl output. What could be causing this? BTW, I have tried both with and without a trailing slash in urls
.
- type: http
name: 'somesite.com'
tags: ['customer']
id: 'somesite.com'
schedule: '@every 60s'
urls: ["http://somesite.com:80/"]
timeout: 5
check.request.method: HEAD
{
"_index": "heartbeat-7.5.0-customer-2019.12",
"_type": "_doc",
"_id": "4ThJ_24B-hakpvoIg4XP",
"_version": 1,
"_score": null,
"_size": 1479,
"_source": {
"observer": {
"ip": "###########",
"geo": {
"name": "AWS EU Frankfurt",
"country_iso_code": "DE",
"city_name": "Frankfurt",
"continent_name": "Europe"
},
"hostname": "###########"
},
"summary": {
"up": 0,
"down": 1
},
"fields": {
"customer": "customer",
"logstash_used": "true",
"index": "heartbeat-7.5.0-customer-2019.12",
"logstash_host": "ip-172-31-24-135",
"size": 1604
},
"tags": [
"customer",
"beats_input_raw_event"
],
"host": {
"name": "###########"
},
"resolve": {
"ip": "###########",
"rtt": {
"us": 321170
}
},
"@version": "1",
"@timestamp": "2019-12-13T12:43:47.074Z",
"url": {
"scheme": "http",
"full": "http://somesite.com:80/",
"domain": "somesite.com",
"path": "/",
"port": 80
},
"error": {
"type": "validate",
"message": "500 Internal Server Error"
},
"ecs": {
"version": "1.1.0"
},
"monitor": {
"type": "http",
"ip": "###########",
"check_group": "10eedc6e-1da6-11ea-8856-029326932cd8",
"name": "somesite.com",
"duration": {
"us": 357687
},
"id": "somesite.com",
"status": "down"
},
"tcp": {
"rtt": {
"connect": {
"us": 15703
}
}
},
"event": {
"dataset": "uptime"
},
"agent": {
"type": "heartbeat",
"hostname": "###########",
"id": "28dd306a-1424-42ce-a543-d68e85641532",
"ephemeral_id": "cd79aee3-8de9-471d-8616-9cc991a3bbbd",
"version": "7.5.0"
},
"http": {
"response": {
"body": {
"bytes": 0,
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"content": ""
},
"status_code": 500
},
"rtt": {
"total": {
"us": 36474
},
"content": {
"us": 31
},
"response_header": {
"us": 20692
},
"write_request": {
"us": 25
},
"validate": {
"us": 20723
}
}
}
},
"fields": {
"availability": [
0
],
"url.link": [
"http://somesite.com"
],
"@timestamp": [
"2019-12-13T12:43:47.074Z"
],
"url.suffix": [
"au"
]
},
"highlight": {
"monitor.name": [
"@kibana-highlighted-field@somesite.com@/kibana-highlighted-field@"
]
},
"sort": [
1576241027074
]
}
curl command:
curl -Iv http://somesite.com:80
* Rebuilt URL to: http://somesite.com:80/
* Trying ###########...
* TCP_NODELAY set
* Connected to somesite.com (###########) port 80 (#0)
> GET / HTTP/1.1
> Host: somesite.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 302 Found
< Keep-Alive: timeout=5, max=1024
< Content-Type: text/html; charset=UTF-8
< Location: http://somesite.com/studio/agegate?rurl=/
< Server: Apache
< Date: Fri, 13 Dec 2019 12:39:21 GMT
< Content-Length: 0
<
* Connection #0 to host somesite.com left intact