Keyword Monitoring
Keyword monitors extend HTTP checks by scanning the response body for a specific string.
Use them to detect silent failures — cases where an endpoint returns 200 OK but the application is actually broken.
Use Cases
| Scenario | Keyword to Check |
|---|---|
| App returns error page with 200 | Absence of "Internal Server Error" |
| Confirm database is connected | Presence of "status":"ok" |
| Detect maintenance mode | Absence of "under maintenance" |
| Confirm CDN is serving fresh content | Presence of a known content marker |
| Verify payment page loads | Presence of "Checkout" |
Creating a Keyword Monitor
- Go to Monitors → New Monitor
- Select Keyword
- Enter the URL and configure HTTP options as normal
- Add keyword rules
Keyword Rule Configuration
| Field | Description |
|---|---|
| Keyword | The exact string to search for (case-insensitive by default) |
| Match Type | Contains — string must be present; Does Not Contain — string must be absent |
| Case Sensitive | Exact case match (default: off) |
You can add multiple keyword rules per monitor. All rules must pass for the check to succeed.
Example Configuration
Goal: Confirm the API returns a healthy JSON response.
URL: https://api.yourapp.com/health
Method: GET
Expected Status: 200
Keyword Rule 1: "status" → Contains
Keyword Rule 2: "error" → Does Not Contain
Result: The check fails if the response body does not contain "status" OR if it contains "error".
API — Create Keyword Monitor
POST /v1/monitors
Authorization: Bearer psk_live_xxx
Content-Type: application/json
{
"name": "API Health Content Check",
"type": "keyword",
"url": "https://api.yourapp.com/health",
"method": "GET",
"interval": 60,
"timeout": 10,
"expectedStatusCode": 200,
"keywords": [
{ "value": "\"status\":\"ok\"", "type": "contains", "caseSensitive": false },
{ "value": "error", "type": "not_contains", "caseSensitive": false }
],
"alertPolicyId": "pol_xxxxxxxx"
}
Limitations
- Keyword search operates on the raw response body — HTML, JSON, or plain text
- Maximum response body scanned: 1 MB (content beyond this is truncated)
- Regular expressions are not supported — use exact strings
- Binary responses are not supported
Troubleshooting
| Symptom | Cause | Resolution |
|---|---|---|
| Monitor DOWN but URL returns 200 | Keyword not found in response | Check actual response body content |
| Intermittent failures | Dynamic content changes | Use a stable marker string |
| Encoding issues | Response uses non-UTF-8 encoding | PingSLA normalizes to UTF-8 automatically |