You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updates the regex to catch both raw and escaped representations of ANSI codes.
- Actually use the cleaned message text instead of the original message text when populating the logInfo struct.
Signed-off-by: Paul Gaiduk <paulg@zededa.com>
"content": "{\"file\":\"/pillar/types/zedmanagertypes.go:364\",\"func\":\"github.com/lf-edge/eve/pkg/pillar/types.AppInstanceStatus.LogModify\",\"level\":\"info\",\"log_event_type\":\"log\",\"msg\":\"App instance status modify\",\"obj_key\":\"app_instance_status-173ee6b9-c454-45b8-959e-5c1e9c91a0ce\",\"obj_name\":\"nginx\",\"obj_type\":\"app_instance_status\",\"obj_uuid\":\"173ee6b9-c454-45b8-959e-5c1e9c91a0ce\",\"old-purge-in-progress\":0,\"old-restart-in-progress\":0,\"old-state\":\"BOOTING\",\"pid\":2221,\"purge-in-progress\":0,\"restart-in-progress\":0,\"source\":\"zedmanager\",\"state\":\"RUNNING\",\"time\":\"2025-10-06T18:31:44.311128265Z\"}",
141
+
"content": `{"file":"/pillar/types/zedmanagertypes.go:364","func":"github.com/lf-edge/eve/pkg/pillar/types.AppInstanceStatus.LogModify","level":"info","log_event_type":"log","msg":"App instance status modify","obj_key":"app_instance_status-173ee6b9-c454-45b8-959e-5c1e9c91a0ce","obj_name":"nginx","obj_type":"app_instance_status","obj_uuid":"173ee6b9-c454-45b8-959e-5c1e9c91a0ce","old-purge-in-progress":0,"old-restart-in-progress":0,"old-state":"BOOTING","pid":2221,"purge-in-progress":0,"restart-in-progress":0,"source":"zedmanager","state":"RUNNING","time":"2025-10-06T18:31:44.311128265Z"}`,
142
+
},
143
+
},
144
+
{
145
+
name: "Entry with ANSI color codes in a JSON message",
146
+
input: `{"time":"2026-02-05T18:52:28.551352594Z","source":"pillar","msg":"{\"appuuid\":\"ff9d588b-e22c-4256-abe4-9da5bae810d9\",\"level\":\"info\",\"msg\":\"Hello, \\u001b[31m this is my text \\u001b[0m. How does it look?\",\"time\":\"2026-02-05T18:52:28.551046324Z\"}"}`,
147
+
expectError: false,
148
+
expectedFields: map[string]string{
149
+
"timestamp": "2026-02-05T18:52:28.551046324Z",
150
+
"source": "pillar",
151
+
"severity": "info",
152
+
"content": `{"appuuid":"ff9d588b-e22c-4256-abe4-9da5bae810d9","level":"info","msg":"Hello, this is my text . How does it look?","time":"2026-02-05T18:52:28.551046324Z"}`,
0 commit comments