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

Incorrect regex match #1708

Closed
jknockaert opened this issue May 7, 2019 · 2 comments
Closed

Incorrect regex match #1708

jknockaert opened this issue May 7, 2019 · 2 comments

Comments

@jknockaert
Copy link
Contributor

Using Ossec 3.3.0.
I defined a decoder:

<decoder name="newdecoder">
  <prematch>{"reqId":"</prematch>
  <regex>"level":(\d+),"time":"\S+","remoteAddr":"(\S*)","user":"\.+","app":"(\S+)","method":"\S*","url":"\S+","message":"(\.+)"</regex>
  <order>status, srcip, action, extra_data</order>
</decoder>

Matching a string with an empty srcip, e.g.

{"reqId":"whatever","level":2,"time":"2019-05-07T12:00:00+02:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"error message","userAgent":"--","version":"15.0.7.0"}

results in news being identified as 'srcip'.

@jubois
Copy link
Contributor

jubois commented May 14, 2019

Hello,
I found the problem and made a PR

@jknockaert
Copy link
Contributor Author

OK, fixed in #1710. I will close this issue after the PR is merged.

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

No branches or pull requests

2 participants