crowdsec icon indicating copy to clipboard operation
crowdsec copied to clipboard

Bug with POSINT in HTTPD_ERRORLOG

Open AdzerKI opened this issue 4 years ago • 1 comments

What would you like to be added?

  1. Find a bug with POSINT in HTTPD_ERRORLOG POSINT = 1-999999999.... not 0, but port could be 0 if it not detected, change plz POSINT -> INT like this

was h.Must("HTTPD24_ERRORLOG", `\[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}(:tid %{NUMBER:tid})?\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_errormessage}:)?( \[client %{IPORHOST:client}:%{POSINT:clientport}\])? %{DATA:errorcode}: %{GREEDYDATA:message}`)

should be **h.Must("HTTPD24_ERRORLOG", `\[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}(:tid %{NUMBER:tid})?\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_errormessage}:)?( \[client %{IPORHOST:client}:%{INT:clientport}\])? %{DATA:errorcode}: %{GREEDYDATA:message}`)**

  1. BUG in apache2-logs.yaml HTTPD_ERRORLOG by default takes HTTPD20_ERRORLOG, not HTTPD24_ERRORLOG

Why is this needed?

very often the port is not detected (logged as 0) and then the parser does not parse the client correctly (not detect IP) this will help fix this bug

AdzerKI avatar Aug 17 '22 03:08 AdzerKI

Hello @AdzerKI,

Sorry for the delay. The fix has been merged here and the crowdsec dependencies has been updated here.

This will be fixe in the next release.

AlteredCoder avatar Oct 26 '22 10:10 AlteredCoder