diff --git a/agent/plugins/inventory/gatherers/application/dataProvider_unix.go b/agent/plugins/inventory/gatherers/application/dataProvider_unix.go index eced4ff11..b504ff3a3 100644 --- a/agent/plugins/inventory/gatherers/application/dataProvider_unix.go +++ b/agent/plugins/inventory/gatherers/application/dataProvider_unix.go @@ -330,7 +330,8 @@ func getApplicationData(context context.T, command string, args []string) (data log.Debugf("Command Stderr: %v", string(output)) err = fmt.Errorf("Command failed with error: %v", string(output)) } else { - cmdOutput := string(output) + cmdOutputRaw := string(output) + cmdOutput := handleCtrlChars(cmdOutputRaw) // parse snap result if command == "snap" { cmdOutput = parseSnapOutput(context, cmdOutput) @@ -348,6 +349,10 @@ func getApplicationData(context context.T, command string, args []string) (data return } +func handleCtrlChars(s string) string { + return strings.Replace(s, "\x0D", "", -1) +} + // convertToApplicationData converts query output into json string so that it can be deserialized easily func convertToApplicationData(input string) (data []model.ApplicationData, err error) {