-
Notifications
You must be signed in to change notification settings - Fork 23
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
Normalize Empty and Invalid Data in Inventory #411
Comments
Related documentation https://github.com/wazuh/wazuh-indexer/tree/master/ecs/docs |
Update 2024/12/17
|
Update 2024/12/18For the case of functions that return integer values, for example, hardware[“cpu_cores”] = getCpuCores().value_or(UNKNOWN_VALUE); Error: /home/vagrant/wazuh-agent/src/common/data_provider/src/sysInfoLinux.cpp:276:51: required from here
/usr/include/c++/13/optional:1042:25: error: static assertion failed
1042 | static_assert(is_convertible_v<_Up&&, _Tp>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/optional:1042:25: note: 'std::is_convertible_v<std::nullptr_t&, int>' evaluates to false
/usr/include/c++/13/optional:1047:20: error: invalid 'static_cast' from type 'std::nullptr_t' to type 'int'
1047 | return static_cast<_Tp>(std::forward<_Up>(__u)); This is because Possible solutions:
if (auto cpuCores = getCpuCores())
{
hardware["cpu_cores"] = *cpuCores;
}
else
{
hardware["cpu_cores"] = UNKNOWN_VALUE;
}
|
Update 2024/12/19
|
Update 2024/12/20
|
Update 2024/12/27
|
Update 2024/12/30
|
Update 2024/12/31
|
Update 2025/01/02
|
Update 2025/01/03
|
Description
The current implementation of the inventory system has inconsistencies in how empty data and invalid types are handled. This issue proposes improvements to standardize data representation and validation, ensuring cleaner and more reliable outputs. The system should report
null
for fields that it could not collect, rather than inventing values or using ambiguous placeholders.Tasks
null
in the output JSON.null
for missing fields.null
or conforms to its expected format.Acceptance Criteria
null
.References
This is a continuation of issue #397.
The text was updated successfully, but these errors were encountered: