diff --git a/event/sdk/common.go b/event/sdk/common.go index e7edf2a3b58e7d29a161a8a36bba9f362fe57223..d6a16d7b053c12b4b191c78125a599c0833096f0 100644 --- a/event/sdk/common.go +++ b/event/sdk/common.go @@ -1,6 +1,6 @@ /* * Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. - * PilotGo-plugins licensed under the Mulan Permissive Software License, Version 2. + * PilotGo-plugins licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 * Date: Wed Jul 24 10:02:04 2024 +0800 @@ -92,7 +92,6 @@ type MDUserSystemSession struct { //平台登录、退出 } type MDHostChange struct { // 主机新增、移除、上线、离线 - HostUUID string `json:"host_uuid"` IP string `json:"ip"` OS string `json:"os"` OSVersion string `json:"os_version"` @@ -102,14 +101,15 @@ type MDHostChange struct { // 主机新增、移除、上线、离线 } type MDHostPackageOpt struct { //软件包安装、升级、卸载 - HostUUID string `json:"host_uuid"` - Name string `json:"name"` - Version string `json:"version"` + HostIP string `json:"hostIp"` + Name string `json:"name"` + Version string `json:"version"` } type MDHostIPChange struct { //主机ip变更 HostUUID string `json:"host_uuid"` NewIP string `json:"new_ip"` + OldIP string `json:"old_ip"` } type MDPluginChange struct { // 插件新增、移除、上线、离线 diff --git a/event/server/db/db.go b/event/server/db/db.go index e6d647fb301ba732ad7192ff290f9fff271fa281..2b3efa284da4c0df451a5ba98388f7aa186c3fc2 100644 --- a/event/server/db/db.go +++ b/event/server/db/db.go @@ -121,13 +121,9 @@ func WriteToDB(MessageData string) error { func processValue(v interface{}) interface{} { value := v.(string) - re := regexp.MustCompile(`(\w+):([^\s\]]+)`) + re := regexp.MustCompile(`(\w+):([^\]]+)`) matches := re.FindAllStringSubmatch(value, -1) - result := make(map[string]string) - for _, match := range matches { - result[match[1]] = match[2] - } if len(matches) > 0 { result := make(map[string]string) for _, match := range matches {