-
Notifications
You must be signed in to change notification settings - Fork 16
/
squidproxy.json
163 lines (163 loc) · 7.55 KB
/
squidproxy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{
"name": "Squid Proxy",
"description": "Folder for Squid Proxy Monitors",
"type": "MonitorsLibraryFolderExport",
"children": [
{
"name": "Squid Proxy - High Latency",
"description": "This alert fires when latency on a node in a Squid Proxy cluster is higher than 3 seconds.",
"type": "MonitorsLibraryMonitorExport",
"monitorType": "Metrics",
"evaluationDelay": "0m",
"runAs": null,
"notificationGroupFields": [],
"queries": [
{
"rowId": "A",
"query": "metric=squid_cacheProtoClientHttpRequests proxy_cluster=* host=* | rate | avg by proxy_cluster,host"
},
{
"rowId": "B",
"query": "metric=squid_cacheHttpAllSvcTime1 proxy_cluster=* host=* | avg by proxy_cluster,host | eval _value/60"
},
{
"rowId": "C",
"query": "(#B/#A)/1000 along proxy_cluster,host"
}
],
"triggers": [
{
"detectionMethod": "MetricsStaticCondition",
"triggerType": "Critical",
"timeRange": "-5m",
"threshold": 3,
"thresholdType": "GreaterThanOrEqual",
"occurrenceType": "Always"
},
{
"detectionMethod": "MetricsStaticCondition",
"triggerType": "ResolvedCritical",
"timeRange": "-5m",
"threshold": 3,
"thresholdType": "LessThan",
"occurrenceType": "Always"
}
],
"notifications": [],
"isDisabled": true,
"groupNotifications": true,
"playbook": ""
},
{
"name": "Squid Proxy - High Client (HTTP 4xx) Error Rate",
"description": "This alert fires when there are too many HTTP requests (>5%) with a response status of 4xx.",
"type": "MonitorsLibraryMonitorExport",
"monitorType": "Logs",
"evaluationDelay": "0m",
"runAs": null,
"notificationGroupFields": [],
"queries": [
{
"rowId": "A",
"query": "proxy_system=squidproxy\n| json \"log\" as message nodrop \n| if (isEMpty(message), _raw, message) as message\n| if (isEmpty(pod),_sourceHost,pod) as host\n| parse regex field = message \"(?<time>[\\d.]+)\\s+(?<elapsed>[\\d]+)\\s+(?<remotehost>[^\\s]+)\\s+(?<action>[^/]+)/(?<status_code>[\\d]+)\\s+(?<bytes>[\\d]+)\\s+(?<method>[^\\s]+)\\s+(?<url>[^\\s]+)\\s(?<rfc931>[^\\s]+)\\s+(?<peerstatus>[^/]+)/(?<peerhost>[^\\s]+)\\s+(?<type>[^\\s|$]+?)(?:\\s+|$)\" nodrop | parse field = message \"Connection: *\\\\r\\\\n\" as connection_status nodrop | parse field = message \"Host: *\\\\r\\\\n\" as host nodrop | parse field = message \"User-Agent: *\\\\r\\\\n\" as user_agent nodrop | parse field = message \"TE: *\\\\r\\\\n\" as te nodrop\n| if (status_code matches \"4*\",1,0) as ClientError\n|sum(ClientError) as ClientErrors, count as TotalRequests by host\n| (ClientErrors/TotalRequests) * 100 as ErrorPercentage\n| where ErrorPercentage > 5\n| fields host, ErrorPercentage, ClientErrors, TotalRequests"
}
],
"triggers": [
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "Critical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "GreaterThanOrEqual",
"field": ""
},
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "ResolvedCritical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "LessThan",
"field": ""
}
],
"notifications": [],
"isDisabled": true,
"groupNotifications": true,
"playbook": ""
},
{
"name": "Squid Proxy - High Server (HTTP 5xx) Error Rate",
"description": "This alert fires when there are too many HTTP requests (>5%) with a response status of 5xx.",
"type": "MonitorsLibraryMonitorExport",
"monitorType": "Logs",
"evaluationDelay": "0m",
"runAs": null,
"notificationGroupFields": [],
"queries": [
{
"rowId": "A",
"query": "proxy_system=squidproxy\n| json \"log\" as message nodrop \n| if (isEMpty(message), _raw, message) as message\n| if (isEmpty(pod),_sourceHost,pod) as host\n| parse regex field = message \"(?<time>[\\d.]+)\\s+(?<elapsed>[\\d]+)\\s+(?<remotehost>[^\\s]+)\\s+(?<action>[^/]+)/(?<status_code>[\\d]+)\\s+(?<bytes>[\\d]+)\\s+(?<method>[^\\s]+)\\s+(?<url>[^\\s]+)\\s(?<rfc931>[^\\s]+)\\s+(?<peerstatus>[^/]+)/(?<peerhost>[^\\s]+)\\s+(?<type>[^\\s|$]+?)(?:\\s+|$)\" nodrop | parse field = message \"Connection: *\\\\r\\\\n\" as connection_status nodrop | parse field = message \"Host: *\\\\r\\\\n\" as host nodrop | parse field = message \"User-Agent: *\\\\r\\\\n\" as user_agent nodrop | parse field = message \"TE: *\\\\r\\\\n\" as te nodrop\n| if (status_code matches \"5*\",1,0) as ServerError\n|sum(ServerError) as ServerErrors, count as TotalRequests by host\n| (ServerErrors/TotalRequests) * 100 as ErrorPercentage\n| where ErrorPercentage > 5\n| fields host, ErrorPercentage, ServerErrors, TotalRequests"
}
],
"triggers": [
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "Critical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "GreaterThanOrEqual",
"field": ""
},
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "ResolvedCritical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "LessThan",
"field": ""
}
],
"notifications": [],
"isDisabled": true,
"groupNotifications": true,
"playbook": ""
},
{
"name": "Squid Proxy - High Denied Request",
"description": "This alert fires when there are too many HTTP denied requests (>5%)",
"type": "MonitorsLibraryMonitorExport",
"monitorType": "Logs",
"evaluationDelay": "0m",
"runAs": null,
"notificationGroupFields": [],
"queries": [
{
"rowId": "A",
"query": "proxy_system=squidproxy\n| json \"log\" as message nodrop \n| if (isEMpty(message), _raw, message) as message\n| if (isEmpty(pod),_sourceHost,pod) as host\n| parse regex field = message \"(?<time>[\\d.]+)\\s+(?<elapsed>[\\d]+)\\s+(?<remotehost>[^\\s]+)\\s+(?<action>[^/]+)/(?<status_code>[\\d]+)\\s+(?<bytes>[\\d]+)\\s+(?<method>[^\\s]+)\\s+(?<url>[^\\s]+)\\s(?<rfc931>[^\\s]+)\\s+(?<peerstatus>[^/]+)/(?<peerhost>[^\\s]+)\\s+(?<type>[^\\s|$]+?)(?:\\s+|$)\" nodrop | parse field = message \"Connection: *\\\\r\\\\n\" as connection_status nodrop | parse field = message \"Host: *\\\\r\\\\n\" as host nodrop | parse field = message \"User-Agent: *\\\\r\\\\n\" as user_agent nodrop | parse field = message \"TE: *\\\\r\\\\n\" as te nodrop\n| if (action matches \"*DENIED*\",1,0) as Denied\n|sum(Denied) as CountDenies, count as TotalRequests by host\n| (CountDenies/TotalRequests) * 100 as DeniedPercentage\n| where DeniedPercentage > 5\n| fields host, DeniedPercentage, CountDenies, TotalRequests"
}
],
"triggers": [
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "Critical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "GreaterThanOrEqual",
"field": ""
},
{
"detectionMethod": "LogsStaticCondition",
"triggerType": "ResolvedCritical",
"timeRange": "-5m",
"threshold": 0,
"thresholdType": "LessThan",
"field": ""
}
],
"notifications": [],
"isDisabled": true,
"groupNotifications": true,
"playbook": ""
}
]
}