Skip to content

Improve @NUMBER@ / @DOUBLE@ support for numbers with signs#5620

Merged
HofiOne merged 2 commits intosyslog-ng:developfrom
smortex:improve-patterndb-sign-support
Feb 24, 2026
Merged

Improve @NUMBER@ / @DOUBLE@ support for numbers with signs#5620
HofiOne merged 2 commits intosyslog-ng:developfrom
smortex:improve-patterndb-sign-support

Conversation

@smortex
Copy link
Contributor

@smortex smortex commented Feb 17, 2026

When parsing numbers using the @NUMBER@ or @DOUBLE@ pattern parsers, some sign are not allowed making PatternDB reject expressions that are properly formatted numbers:

  • Explicit + signs are rejected at the beginning of a number / exponent part of a number:
    • +1000
    • +1.5
    • 1e+3
    • +0xFF
  • A - sign before an hexadecimal value is also rejected:
    • -0xFF

Make sure these value are properly parsed.

Fixes #5406

@kira-syslogng
Copy link
Contributor

Can one of the admins verify this patch?

1 similar comment
@kira-syslogng
Copy link
Contributor

Can one of the admins verify this patch?

@smortex smortex changed the title Improve @NUMBER@ / @DOUBLE@ support for numbers with signs Improve @NUMBER@ / @DOUBLE@ support for numbers with signs Feb 17, 2026
@therandomstring
Copy link
Contributor

@kira-syslogng test this please

@czanik
Copy link
Collaborator

czanik commented Feb 18, 2026

Thanks for your contribution! We started the test builds now, but will most likely get to the actual code review only early next week.

@smortex
Copy link
Contributor Author

smortex commented Feb 18, 2026

Thanks for your contribution! We started the test builds now, but will most likely get to the actual code review only early next week.

I just realized that I worked on top of master instead of develop. I will rebase on top of the develop branch, so the tests result will vanished. There were currently 3 failures, the first one is maybe linked to targeting the wrong branch (as there are changes in develop not in master related to bpf), the 2 others seems to be that fedora drop support for older CMake:

  1. Analyze (c-cpp) -- bpftool not found
  2. create-packages / fedora-rawhide-amd64 -- Compatibility with CMake < 3.5 has been removed from CMake
  3. create-packages / fedora-rawhide-arm64 -- Compatibility with CMake < 3.5 has been removed from CMake

@smortex smortex force-pushed the improve-patterndb-sign-support branch from 4ffe5e7 to 43eb763 Compare February 18, 2026 17:26
@HofiOne
Copy link
Collaborator

HofiOne commented Feb 23, 2026

Thanks for your contribution! We started the test builds now, but will most likely get to the actual code review only early next week.

I just realized that I worked on top of master instead of develop. I will rebase on top of the develop branch, so the tests result will vanished. There were currently 3 failures, the first one is maybe linked to targeting the wrong branch (as there are changes in develop not in master related to bpf), the 2 others seems to be that fedora drop support for older CMake:

1. [Analyze (c-cpp)](https://github.com/syslog-ng/syslog-ng/actions/runs/22109728260/job/63972104785?pr=5620#logs) -- bpftool not found

2. [create-packages / fedora-rawhide-amd64](https://github.com/syslog-ng/syslog-ng/actions/runs/22109728356/job/63972241983?pr=5620#logs) -- Compatibility with CMake < 3.5 has been removed from CMake

3. [create-packages / fedora-rawhide-arm64](https://github.com/syslog-ng/syslog-ng/actions/runs/22109728356/job/63972241980?pr=5620#logs) -- Compatibility with CMake < 3.5 has been removed from CMake

Fedora issues will be solved by #5619

@smortex smortex force-pushed the improve-patterndb-sign-support branch from 43eb763 to 6bd55db Compare February 23, 2026 16:57
PatternDB currently accept no sign or a minus sign before a number, but
an explicit plus sign is rejected.

Allow an explicit plus sign to be present.

Signed-off-by: Romain Tartière <[email protected]>
Only hexadecimal numbers without a sign are accepted by PatternDB.

An hexadecimal number my have a negative sign or an explicit positive
sign. Add support for them.

Signed-off-by: Romain Tartière <[email protected]>
@smortex smortex force-pushed the improve-patterndb-sign-support branch from 6bd55db to 390c05d Compare February 23, 2026 17:07
@smortex smortex requested a review from HofiOne February 23, 2026 17:08
@HofiOne
Copy link
Collaborator

HofiOne commented Feb 24, 2026

@kira-syslogng test this please

Copy link
Collaborator

@HofiOne HofiOne left a comment

Choose a reason for hiding this comment

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

Thank you!

@HofiOne HofiOne merged commit 027fc44 into syslog-ng:develop Feb 24, 2026
211 of 213 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.

Enhance @NUMBER@ Parser to Support Explicit Positive Numbers with + Prefix. currenty + sign not supporting.

5 participants