Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line can be nil in Win32_Process #110

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

jsoriano
Copy link
Member

Command line can be nil, what produces errors like:

wmi: cannot load field "CommandLine" into a "string": unsupported type (<nil>)`

Change command line in receiving struct to be a pointer, so it can be converted by wmi if it receives a nil.

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I should note that we have a way to bypass WMI to get this information in go-sysinfo. It uses a system call so it's a lot faster than WMI. For Metricbeat we might want to consider this option for getting the args.

@jsoriano
Copy link
Member Author

Oh, interesting, I'll try to replace gosigar by go-sysinfo for processes collection in metricbeat.

@jsoriano jsoriano merged commit f498c67 into elastic:master Nov 15, 2018
@jsoriano jsoriano deleted the nil-command-line branch November 15, 2018 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants