Fix newline handling in fleetctl convert (#1856)

Previously we stripped all non-word characters which worked for some cases, but
removed necessary characters in others. What we really want (and now do) is to
remove only whitespace characters.

Fixes #1854
This commit is contained in:
Zachary Wasserman
2018-06-28 12:02:46 -07:00
committed by GitHub
parent 88cc73e4ca
commit a7dd64fb0b
+1 -1
View File
@@ -104,7 +104,7 @@ func convertCommand() cli.Command {
// valid JSON but osquery accepts them) and replace
// with \n so that we get them in the YAML output where
// they are allowed.
re := regexp.MustCompile(`\W*\\\n`)
re := regexp.MustCompile(`\s*\\\n`)
b = re.ReplaceAll(b, []byte(`\n`))
var specs *specGroup