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 logcollector multi-line #754

Merged
merged 3 commits into from Jun 8, 2018
Merged

Fix logcollector multi-line #754

merged 3 commits into from Jun 8, 2018

Conversation

bah07
Copy link
Contributor

@bah07 bah07 commented Jun 8, 2018

Fixes the feature to group with the option multi-line in logcollector.

With configuration:

  <localfile>
    <log_format>multi-line:3</log_format>
    <location>/logcollector/test.log</location>
  </localfile>

The log receive nexts lines:

Test line 1
Test line 2
Test line 3
Test line 4
Test line 5
Test line 6
Test line 7

Logcollector generate the output:

(ag-ubu16) any->/logcollector/test.log Test line 1 Test line 2 Test line 3
(ag-ubu16) any->/logcollector/test.log Test line 4 Test line 5 Test line 6

@bah07 bah07 added the type/bug Something isn't working label Jun 8, 2018
@bah07 bah07 changed the base branch from master to 3.3 June 8, 2018 15:13
@bah07 bah07 added this to In progress in Wazuh 3.3 via automation Jun 8, 2018
@@ -214,7 +214,7 @@ void LogCollectorStart()
logff[i].file = NULL;
}
logff[i].read = read_djbmultilog;
} else if (logff[i].logformat[0] >= '0' && logff[i].logformat[0] <= '9') {
} else if (strstr(logff[i].logformat, "multi-line:")) {
Copy link
Member

Choose a reason for hiding this comment

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

Please consider using strncmp() to check that the string starts with "multi-line:".

@vikman90 vikman90 merged commit 8989242 into 3.3 Jun 8, 2018
Wazuh 3.3 automation moved this from In progress to Done Jun 8, 2018
@vikman90 vikman90 deleted the fix-logcollector-multiline branch June 8, 2018 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
No open projects
Wazuh 3.3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants