Close #18: Support monitoring TCP services

This commit is contained in:
TwinProduction
2020-10-04 19:49:02 -04:00
parent 6a3f65db7f
commit 3ecfe4d322
7 changed files with 155 additions and 27 deletions

View File

@@ -12,6 +12,7 @@ const (
IPPlaceHolder = "[IP]"
ResponseTimePlaceHolder = "[RESPONSE_TIME]"
BodyPlaceHolder = "[BODY]"
ConnectedPlaceHolder = "[CONNECTED]"
LengthFunctionPrefix = "len("
PatternFunctionPrefix = "pat("
@@ -35,6 +36,8 @@ func sanitizeAndResolve(list []string, result *Result) []string {
element = strconv.Itoa(int(result.Duration.Milliseconds()))
case BodyPlaceHolder:
element = body
case ConnectedPlaceHolder:
element = strconv.FormatBool(result.Connected)
default:
// if contains the BodyPlaceHolder, then evaluate json path
if strings.Contains(element, BodyPlaceHolder) {