-
Notifications
You must be signed in to change notification settings - Fork 186
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
Review the fields of the wazuh-monitoring index #4924
Conversation
Thought: This approach is a breaking change. This is not backward compatible, so this means, the users after installing a plugin that contains these changes, could not see in the visualization of the plugin data related to a range of time previous to the plugin installation. In the other hand, some users could have a use case that uses the current indexed data where other fields are used. We should be sure of the consequences of these changes before integrating them. Related issue #3625 to the issue that solves this pull request. |
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.
Missing changelog.
The code looks good. The visualization definition should be tested in Kibana 7.16.x and 7.17.x.
|
thought: consider if the visualization of the agent status evolution is using the feature of allowed agents. If it does, then the suggested approach to index the computed data, will avoid the allowed agents feature can work. I am not sure if this has been taken into account. |
Description
This PR aims to reduce the amount of data stored in the
wazuh-monitoring
index.That index is only used for a visualization, which can be achieved with much less data, saving storage space and improving performance.
By default, every 15 minutes one log with the following structure is saved on the index for every agent:
With the proposed changes, only one log will be saved regardless of the number of agents, with the following structure:
To achieve that, instead of fetching all the agents and storing their information to verify the status, we fetch the strictly required fields for the visualization from the /agents/summary/status endpoint.
This allows us to reduce the amount of space required and the number of requests made to the API considerably, especially in environments with a high number of agents.
Issues Resolved
#4388
Evidence
After the changes, the visualization works in the same way.
Test
To test this PR, a valid response from the /agents/summary/status endpoint is needed. In case of using the Docker development environments and imposter, the changes from #4934 are needed.
It is also recommended to modify the frequency of the Task:monitoring, in Wazuh/Settings/Configurations to a lower number (in seconds, minimum is 60), to allow more logs coming to the index in less time (by default is every 15 minutes).
Scenario: have a Wazuh environment with at least one agent and wait for the necessary time to create several logs
When the user navigates to the
Agents
tabThen the
evolution
visualization on the top-right side of the window should be displayed correctly.Scenario: have a Wazuh environment with at least one agent and wait for the necessary time to create several logs
When the user adds or disconnects an agent, wait for the time to create a new log and navigates to the
Agents
tabThen the
evolution
visualization on the top-right side of the window should display that change correctly.*Note: if using imposter, the adding and disconnecting of the agents can be done modifying the file with the response and restarting imposter.
Check List
yarn test:jest