From 060468aacacb99b4cadb9aba144f871a6efbbbed Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Mon, 25 Oct 2021 10:14:46 -0400 Subject: [PATCH] Osquerybeat: Fix host_processes missing cmdline arguments --- .../osquerybeat/ext/osquery-extension/internal/proc/cmdline.go | 3 +++ 1 file changed, 3 insertions(+) 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 }