Skip to content

fix: correctly extract username from invalid user SSH log lines - #31

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
pxivory-max:fix/issue-26-invalid-user-parsing
Jun 23, 2026
Merged

fix: correctly extract username from invalid user SSH log lines#31
ralyodio merged 1 commit into
profullstack:masterfrom
pxivory-max:fix/issue-26-invalid-user-parsing

Conversation

@pxivory-max

Copy link
Copy Markdown
Contributor

Summary

  • Adds INVALID_USER_REGEX to specifically match "Failed password for invalid user <name>" lines
  • Tries the more specific regex before the general USER_REGEX so the actual attempted username is captured instead of the literal word "invalid"

Fixes #26

Gig: https://ugig.net/gigs/14eb1fad-1c95-4ba9-bd6f-5b6f9de1a664

Test plan

  • Parse Failed password for invalid user admin from 203.0.113.10 port 54321 ssh2fields.user should be "admin"
  • Parse Failed password for root from 203.0.113.10 port 54321 ssh2fields.user should still be "root"

The USER_REGEX matched "for" then captured "invalid" as the username.
Add a more specific INVALID_USER_REGEX that matches the full "for invalid
user <name>" pattern and try it first.

Fixes profullstack#26

Co-Authored-By: Claude <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 9a94923 into profullstack:master Jun 23, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

Auth log parser captures invalid instead of the attempted SSH username

2 participants