diff --git a/x-pack/osquerybeat/ext/osquery-extension/internal/proc/cmdline.go b/x-pack/osquerybeat/ext/osquery-extension/internal/proc/cmdline.go index 3ed7c2bb047..c72dd43a511 100644 --- a/x-pack/osquerybeat/ext/osquery-extension/internal/proc/cmdline.go +++ b/x-pack/osquerybeat/ext/osquery-extension/internal/proc/cmdline.go @@ -5,6 +5,7 @@ package proc import ( + "bytes" "io/ioutil" "strings" ) @@ -17,5 +18,7 @@ func ReadCmdLine(root string, pid string) (string, error) { return "", err } + b = bytes.ReplaceAll(b, []byte{0}, []byte{' '}) + return strings.TrimSpace(string(b)), nil }