diff --git a/model.go b/model.go index 1cc4e29..6a4d115 100644 --- a/model.go +++ b/model.go @@ -485,17 +485,21 @@ func getTargetBody() string { } func getIdFromTargetResponse(body io.Reader) string { - type TargetConf struct { + type TargetConfInner struct { Type string `json:"type"` Id string `json:"id"` } + type TargetConf struct { + Target TargetConfInner + Enabled bool + } var response []TargetConf if err := json.NewDecoder(body).Decode(&response); err != nil { fmt.Printf("Error decoding: %v\n", err) } target := response[0] - return target.Id + return target.Target.Id } func getAlertBody(stream string, targetId string) string {