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

Fix logbuilder for target 'agent' on <localfile> #4942

Merged
merged 1 commit into from Apr 24, 2020

Conversation

FernandoCP
Copy link
Contributor

@FernandoCP FernandoCP commented Apr 22, 2020

Related issue
#4877

Description

The problem was that the <out_format> tag didn't work when the <localfile> target was "agent". This was caused by a modification that was made in the PR #4696, and it made that the messages that had target agent were sent without being built as a log.

To fix this I have added that the SendMSGtoSCK() function considers the target agent and sends it in a normal way after building the log. I have also changed the call to the function to send the log when the target is an agent.

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X
  • Source installation
  • Source upgrade

Tests specified here: wazuh/wazuh-qa#656

@FernandoCP FernandoCP changed the base branch from master to 3.12 April 22, 2020 07:08
@FernandoCP FernandoCP changed the title 4877 fix logbuilder target agent Fix logbuilder for target 'agent' on <localfile> Apr 22, 2020
@vikman90 vikman90 self-requested a review April 22, 2020 09:41
src/shared/mq_op.c Show resolved Hide resolved
@vikman90 vikman90 self-assigned this Apr 24, 2020
@vikman90 vikman90 added type/bug Something isn't working type/bug/regression Breaks functionality known to work in previous releases module/logcollector labels Apr 24, 2020
@wazuhci-staging
Copy link

Analysis_dynamic_valgrind logcollector analysis:

Commit: c21fc1a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:31.41% of 1859

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B567.log

@wazuhci-staging
Copy link

Analysis_dynamic_valgrind syscheckd analysis:

Commit: c21fc1a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:26.49% of 2997

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B568.log

@wazuhci-staging
Copy link

Analysis_dynamic_valgrind logcollector analysis:

Commit: c21fc1a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:31.41% of 1859

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B569.log

@wazuhci-staging
Copy link

Analysis_dynamic_valgrind syscheckd analysis:

Commit: c21fc1a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:26.49% of 2997

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B570.log

@FernandoCP FernandoCP force-pushed the 4877-Fix-logbuilder-target-agent branch from c21fc1a to 1df4c2b Compare April 24, 2020 13:22
@wazuhci-staging
Copy link

Analysis_dynamic_valgrind logcollector analysis:

Commit: 1df4c2b
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:31.41% of 1859

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B571.log

Copy link
Member

@vikman90 vikman90 left a comment

Choose a reason for hiding this comment

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

LGTM!

@wazuhci-staging
Copy link

Analysis_dynamic_valgrind syscheckd analysis:

Commit: 1df4c2b
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:26.49% of 2997

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B572.log

@wazuhci-staging
Copy link

Analysis_dynamic_valgrind logcollector analysis:

Commit: 1df4c2b
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:31.41% of 1859

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B573.log

@vikman90 vikman90 merged commit 910ea47 into 3.12 Apr 24, 2020
@vikman90 vikman90 deleted the 4877-Fix-logbuilder-target-agent branch April 24, 2020 14:01
@wazuhci-staging
Copy link

Analysis_dynamic_valgrind syscheckd analysis:

Commit: 1df4c2b
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:26.49% of 2997

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.12.3-B574.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/logcollector type/bug/regression Breaks functionality known to work in previous releases type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants