-
Notifications
You must be signed in to change notification settings - Fork 195
Description
Describe the bug
When I use https://app.crowdsec.net/hub/author/gauth-fr/collections/immich for my Immich server, it can't parse the logs.
Here is an example log string (from journalctl): Dez 10 13:40:02 host immich[400]: [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167.
Note the date format: 10.12.2025 instead of 12/10/2025. When I change the line IMMICH_CUSTOMDATE: "%{MONTHNUM2}/%{MONTHDAY}/%{YEAR}, %{TIME}" to IMMICH_CUSTOMDATE: "%{MONTHDAY}.%{MONTHNUM2}.%{YEAR}, %{TIME}" in immich-logs.yaml I can see this via explain:
cscli explain -l "Dez 10 13:40:02 host immich[400]: [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167" -t syslog -v
line: Dez 10 13:40:02 host immich[400]: [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167
β s00-raw
| β π’ crowdsecurity/syslog-logs (+12 ~9)
| β update evt.ExpectMode : %!s(int=0) -> 1
| β update evt.Stage : -> s01-parse
| β update evt.Line.Raw : -> Dez 10 13:40:02 host immich[400]: [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167
| β update evt.Line.Src : -> /tmp/cscli_explain22703678/cscli_test_tmp.log
| β update evt.Line.Time : 0001-01-01 00:00:00 +0000 UTC -> 2025-12-10 13:45:42.607593638 +0000 UTC
| β create evt.Line.Labels.type : syslog
| β update evt.Line.Process : %!s(bool=false) -> true
| β update evt.Line.Module : -> file
| β create evt.Parsed.timestamp8601 :
| β create evt.Parsed.facility :
| β create evt.Parsed.logsource : syslog
| β create evt.Parsed.message : [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167
| β create evt.Parsed.pid : 400
| β create evt.Parsed.priority :
| β create evt.Parsed.program : immich
| β create evt.Parsed.timestamp : Dez 10 13:40:02
| β update evt.Time : 0001-01-01 00:00:00 +0000 UTC -> 2025-12-10 13:45:42.607632844 +0000 UTC
| β update evt.StrTime : -> Dez 10 13:40:02
| β create evt.Meta.datasource_path : /tmp/cscli_explain22703678/cscli_test_tmp.log
| β create evt.Meta.datasource_type : file
| β create evt.Meta.machine : host
β s01-parse
| β π’ gauth-fr/immich-logs (+6 ~4)
| β update evt.Stage : s01-parse -> s02-enrich
| β update evt.Parsed.timestamp : Dez 10 13:40:02 -> 10.12.2025, 13:40:02
| β create evt.Parsed.source_ip : 192.168.230.167
| β create evt.Parsed.username : [email protected]
| β update evt.StrTime : Dez 10 13:40:02 -> 10.12.2025, 13:40:02
| β update evt.StrTimeFormat : -> 01/02/2006, 15:04:05
| β create evt.Meta.log_type : immich_failed_auth
| β create evt.Meta.service : immich
| β create evt.Meta.source_ip : 192.168.230.167
| β create evt.Meta.user : [email protected]
β s02-enrich
| β π’ crowdsecurity/dateparse-enrich (+2 ~2)
| β create evt.Enriched.MarshaledTime : 1970-01-01T01:00:10+01:00
| β update evt.Time : 2025-12-10 13:45:42.607632844 +0000 UTC -> 1970-01-01 01:00:10 +0100 CET
| β update evt.MarshaledTime : -> 1970-01-01T01:00:10+01:00
| β create evt.Meta.timestamp : 1970-01-01T01:00:10+01:00
| β π΄ crowdsecurity/geoip-enrich
| β π’ crowdsecurity/public-dns-allowlist (unchanged)
β-------- parser success π’
β Scenarios
β π’ gauth-fr/immich-bf
β π’ gauth-fr/immich-bf_user-enum
Maybe there other failures too, I test it only with this single change.
To Reproduce
cscli explain -l "Dez 10 13:40:02 host immich[400]: [Nest] 400 - 10.12.2025, 13:40:02 WARN [Api:AuthService~8hfctsaf] Failed login attempt for user [email protected] from ip address 192.168.230.167" -t syslog -v
Expected behavior
No errors and a parsable log entry
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I'm running Immich via NixOS and so the logging is via syslog:
---
source: journalctl
journalctl_filter:
- "SYSLOG_IDENTIFER=immich-server"
labels:
type: syslog
I don't think that bother something, only the date format is in another language. But I would expect that this shouldn't matter Crowdsec at all.
Also note: My Server doesn't use UTC but Crowdsec does think this timestamp is UTC, that is NOT CORRECT.
update evt.Time : 2025-12-10 13:45:42.607632844 +0000 UTC -> 1970-01-01 01:00:10 +0100 CET