-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add logger_snapshot_event_type flag for snapshot events #3838
Conversation
@theopolis has updated the pull request. View: changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple hold overs from the old code
osquery/core/query.cpp
Outdated
pt::ptree& tree) { | ||
addLegacyFieldsAndDecorations(item, tree); | ||
pt::ptree columns; | ||
for (auto& i : event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
?
osquery/core/query.cpp
Outdated
if (!status.ok()) { | ||
return status; | ||
} | ||
} else if (item.snapshot_results.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer !item.snapshot_results.empty()
osquery/core/query.cpp
Outdated
return Status(1, "No diff results or snapshot results"); | ||
} | ||
|
||
for (auto& action : results) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be const
s?
osquery/core/query.cpp
Outdated
Status serializeQueryLogItemAsEvents(const QueryLogItem& item, | ||
pt::ptree& tree) { | ||
pt::ptree results; | ||
if (item.results.added.size() > 0 || item.results.removed.size() > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, prefer not empty
@theopolis has updated the pull request. View: changes |
This implements #3701.