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

Increase the default max buckets #2901

Merged
merged 4 commits into from Feb 5, 2021

Conversation

pablomarga
Copy link
Contributor

Hi team! This PR solved the problem that was caused when entering Statistics and executing a query greater than 1 day.
Closes #2765

@pablomarga pablomarga requested a review from a team February 2, 2021 14:30
@pablomarga pablomarga self-assigned this Feb 3, 2021
@frankeros frankeros changed the base branch from 4.0-7.10 to 4.1-7.10 February 3, 2021 13:38
}

async function updateMaxBucketsSetting(isModified: boolean) {
console.log("ENTRA AQUI 3")
Copy link
Member

Choose a reason for hiding this comment

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

Please remove this console.log

return !isModified && await GenericRequest.request(
'POST',
'/api/kibana/settings',
{ "changes": { "timelion:max_buckets": JSON.stringify(WAZUH_MAX_BUCKETS_DEFAULT) } }
Copy link
Member

@Desvelao Desvelao Feb 4, 2021

Choose a reason for hiding this comment

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

The WAZUH_MAX_BUCKETS_DEFAULT is a number, you don't need to do:

JSON.stringify(WAZUH_MAX_BUCKETS_DEFAULT)

Simply, you could do:

{ "changes": { "timelion:max_buckets": WAZUH_MAX_BUCKETS_DEFAULT } }

}

const maxBuckets = settings["timelion:max_buckets"].userValue;
const maxBucketsObject = JSON.parse(maxBuckets);
Copy link
Member

Choose a reason for hiding this comment

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

Why use JSON.parse here? It should be a number.

Copy link
Contributor

@frankeros frankeros left a comment

Choose a reason for hiding this comment

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

I tested it, and everything seems ok, but you forgot to add the config in initial-wazuh-congit.ts, please add it and add the changelog.

Good Job!

@frankeros frankeros merged commit 30caa76 into 4.1-7.10 Feb 5, 2021
@frankeros frankeros deleted the feature/increse-default-max-buckets branch February 5, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants