Warning: Permanently added '54.166.245.126' (ED25519) to the list of known hosts. You can reproduce this build on your computer by running: sudo dnf install copr-rpmbuild /usr/bin/copr-rpmbuild --verbose --drop-resultdir --srpm --task-url https://copr.fedorainfracloud.org/backend/get-srpm-build-task/11371751 Version: 1.11 PID: 11862 Logging PID: 11864 Task: {'appstream': False, 'background': True, 'build_id': 11371751, 'chroot': None, 'distributions_in_build': ['centos-stream-10', 'centos-stream-9', 'epel-10', 'epel-9', 'fedora-43', 'fedora-44', 'fedora-45', 'fedora-rawhide', 'rhel-10', 'rhel-9'], 'distributions_in_project': ['centos-stream-10', 'centos-stream-9', 'epel-10', 'epel-9', 'fedora-43', 'fedora-44', 'fedora-45', 'fedora-rawhide', 'rhel-10', 'rhel-9'], 'package_name': 'syslogcef', 'project_dirname': 'syslogcef', 'project_name': 'syslogcef', 'project_owner': 'allamiro', 'repos': [], 'sandbox': 'allamiro/syslogcef--https://api.github.com/users/allamiro', 'source_json': {'clone_url': 'https://github.com/allamiro/syslog2cef.git', 'committish': 'fceea31a2ebfcb1db79b6a791b6048350d051b88', 'spec': 'syslogcef.spec', 'srpm_build_method': 'rpkg', 'subdirectory': 'packaging/rpm', 'type': 'git'}, 'source_type': 8, 'submitter': 'https://api.github.com/users/allamiro', 'task_id': '11371751'} Running: git clone https://github.com/allamiro/syslog2cef.git /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef --depth 500 --no-single-branch --recursive cmd: ['git', 'clone', 'https://github.com/allamiro/syslog2cef.git', '/var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef', '--depth', '500', '--no-single-branch', '--recursive'] cwd: . rc: 0 stdout: stderr: Cloning into '/var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef'... Running: git checkout fceea31a2ebfcb1db79b6a791b6048350d051b88 -- cmd: ['git', 'checkout', 'fceea31a2ebfcb1db79b6a791b6048350d051b88', '--'] cwd: /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef rc: 0 stdout: stderr: Note: switching to 'fceea31a2ebfcb1db79b6a791b6048350d051b88'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at fceea31 Make custom parsers easier to write, test and debug (#129) Generated rpkg config: [rpkg] preprocess_spec = True [git] anon_clone_url = https://github.com/%(repo_path)s [lookaside] download_url = https://${git_props:remote_netloc}/repo/pkgs/%(repo_path)s/%(filename)s/%(hashtype)s/%(hash)s/%(filename)s Writing config into /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/.config/rpkg.conf Running: rpkg srpm --outdir /var/lib/copr-rpmbuild/results --spec /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef/packaging/rpm/syslogcef.spec cmd: ['rpkg', 'srpm', '--outdir', '/var/lib/copr-rpmbuild/results', '--spec', '/var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef/packaging/rpm/syslogcef.spec'] cwd: /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef/packaging/rpm rc: 0 stdout: Wrote: /var/lib/copr-rpmbuild/results/syslog2cef.spec setting SOURCE_DATE_EPOCH=1795219200 Wrote: /var/lib/copr-rpmbuild/results/syslog2cef-0.4.2-1.src.rpm stderr: syslog2cef_git_sdist: archiving /var/lib/copr-rpmbuild/workspace/workdir-6guq_2_o/syslog2cef: commit fceea31a2ebfcb1db79b6a791b6048350d051b88 (HEAD, origin/main, origin/HEAD, main) Author: Tamir Suliman Date: Sat Nov 21 17:24:58 2026 +0100 Make custom parsers easier to write, test and debug (#129) * Add regex shorthands for pattern files * Add --check-patterns to run pattern file examples New module syslogcef/pattern_check.py runs the examples attached to each loaded pattern, checks that the expected line or msg pattern matched and that the expected fields came out, and renders a PASS/FAIL report with a total. --check-patterns requires --patterns, reads no input, and exits 1 when any example fails. * Add --explain and --stats CLI introspection --explain prints, per input line, the parser, line and msg pattern names, the mapping that was selected (--mapping, pattern or auto ), the fields available to mapping templates and the CEF record. --stats prints line counts per parser and msg pattern plus samples of unmatched lines to stderr when input ends or the run is interrupted. StreamConverter gains convert_event(), which returns the CEF record together with the normalized event; convert() is unchanged for callers. * Carry pattern captures and pattern names through normalization ParsedEvent gains fields, pattern and msg_pattern (appended with defaults). normalize() copies them onto the NormalizedEvent and merges the captured fields into kv after raw_kv is built from the message and before alias canonicalization, so captures win over message key=value text, gain their canonical CEF names, and are usable in mapping templates. * Add msg patterns, captured fields and per-pattern mappings to pattern files Pattern file entries accept new keys: - match: "line" (default, as before) or "msg", which applies the regex with search() to the message of an already parsed event; the first matching msg pattern in load order wins - app: msg patterns only, case-insensitive app filter (string or list) - mapping: bundled mapping name or mapping JSON path (relative to the pattern file), loaded and validated at load time and used when no explicit mapping is given; a msg pattern's mapping wins - examples: list of {line, expect, matches} objects, structure validated at load and stored on the pattern Extra named groups in line patterns now become captured fields instead of a load error; every group of a msg pattern is a captured field. Derived field names are reserved, envelope groups are rejected in msg patterns, kind-specific keys on the wrong kind and unknown keys are load errors. New custom.apply_msg_patterns, loaded_patterns and mapping_for; parse_syslog applies msg patterns and to_cef consults the pattern mapping before the heuristic. A _expand_shorthands hook runs before regex compilation. * Document pattern authoring: guide, examples, README, man page Add docs/patterns.md, a step-by-step guide to writing pattern files with an OpenSSH walkthrough and a reference for every pattern key, shorthand, reserved name, example rule and load error. Add example pattern and mapping files under examples/patterns/. Document --explain, --stats and --check-patterns in the README options table and the man page, which also gains a PATTERN FILES section, and add the changelog entries. * Expand %{NAME} shorthands when loading pattern files Replace the identity placeholder in custom.load_patterns with syslogcef.shorthands.expand. An unknown shorthand raises PatternFileError naming the pattern file and the pattern. Tests load pattern files that use %{IP:src}, %{USER:suser}, %{PORT:spt} and friends in line and msg patterns. * Warn on unknown pattern keys instead of failing; add description Pattern entries accept an optional "description" string. Any other unknown key in a pattern or an example no longer fails loading: it is ignored, logged as a warning on the syslogcef.custom logger naming the file, pattern and key, and recorded in CustomPattern.warnings. --check-patterns reports each warning as a failure line ("FAIL config: unknown key 'exmaples'"), adds the count to the totals line and exits 1, so typos are still caught in CI. Pool workers under --multiprocess do not repeat the warnings. README, docs/patterns.md, the man page and CHANGELOG describe the policy and the description key. The --check-patterns CLI tests no longer carry the skip marker used before the core branch was merged. * Apply app-filtered msg patterns to continuation lines parse_syslog runs the msg patterns before StreamConverter.convert_event lets a continuation line inherit app, host and timestamp from the preceding event, so a msg pattern limited to an app could never match an indented continuation line. Run the msg patterns again after the inheritance when none matched on the first pass. * Exit with status 130 and no traceback on Ctrl-C --tail and --listen are stopped with Ctrl-C, which printed a KeyboardInterrupt traceback after the --stats summary. main now catches KeyboardInterrupt around the run and returns 130; the --stats summary is still printed while the interrupt unwinds the conversion loop. Pool workers ignore SIGINT so --multiprocess runs do not print worker tracebacks either. The man page documents exit status 130. * Replace simulated sample output in the pattern docs with real output Every --stats summary, --explain block, --check-patterns report, CEF record and error message in docs/patterns.md was produced by running the command shown against the merged code. Commands that need a log file use the new examples/patterns/secure.log (the two sshd lines the guide works with) in place of /var/log/secure, and the guide says so. Changes from the simulated text: --stats counts for the two-line sample, the trailing space --explain prints after an empty value, a complete failing --check-patterns report, a real usage error for an unknown shorthand, both converted CEF lines, and a --stats run that shows the msg pattern section. The commands in the README "Custom Parsers" section and the man page EXAMPLES, and the pattern JSON they show, were run as well and needed no changes. tests/test_pattern_examples.py runs --check-patterns on the shipped example files so they cannot rot; it skips where examples/ is not shipped (the sdist). * Add end-to-end tests for pattern authoring through the CLI A pattern file combines a shorthand-based line pattern for an unknown header, a msg pattern with an app filter, a mapping referenced relative to the pattern file, and examples. The CLI runs from an unrelated working directory and the tests check --check-patterns, the --explain pattern, msg pattern, mapping and field lines, the --stats msg pattern section, CEF output through the pattern's mapping, and that --mapping still overrides it. * Choose msg patterns after continuation context is applied StreamConverter ran msg patterns inside parse_syslog, before a continuation line inherited its app and lost its indentation, and only retried when nothing had matched. An unfiltered fallback could then claim the line ahead of an app-filtered pattern that is earlier in load order and would win on a normal line from that app, changing both the captured fields and the mapping. The converter now parses the envelope without msg patterns and applies them once, to the completed event. * Capture IPv4-mapped IPv6 addresses whole in %{IPV6} and %{IP} The hex alternative came before the IPv4-suffix alternative, so under re.search (how msg patterns run) "::ffff:192.168.1.1" was captured as "::ffff:192". The IPv4 suffix is now tried first, and tests check captures through re.search rather than only re.fullmatch. syslog2cef_git_sdist: Wrote: /var/lib/copr-rpmbuild/results/syslog2cef-0.4.2.tar.gz Building target platforms: noarch Building for target noarch Output: ['syslogcef.logrotate', 'syslogcef.conf', 'syslogcef@.service', 'syslog2cef.spec', 'syslogcef.service', 'syslogcef.sysusers', 'syslog2cef-0.4.2-1.src.rpm', 'syslogcef-instance.conf', 'syslog2cef-0.4.2.tar.gz', 'syslogcef.1'] Running SRPMResults tool Using distributions_in_build for this build. Extracting arch-specific tags for centos-stream-10 Extracting arch-specific tags for centos-stream-9 Extracting arch-specific tags for epel-10 Extracting arch-specific tags for epel-9 Extracting arch-specific tags for fedora-43 Extracting arch-specific tags for fedora-44 Extracting arch-specific tags for fedora-45 Extracting arch-specific tags for fedora-rawhide Extracting arch-specific tags for rhel-10 Extracting arch-specific tags for rhel-9 Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef.service Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef.conf Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef.sysusers Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef@.service Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef.logrotate Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef.1 Failed to create a dummy source: /var/lib/copr-rpmbuild/results/syslogcef-instance.conf Package info: { "architecture_specific_tags": { "centos-stream-10": { "buildarch": [ "noarch" ] }, "centos-stream-9": { "buildarch": [ "noarch" ] }, "epel-10": { "buildarch": [ "noarch" ] }, "epel-9": { "buildarch": [ "noarch" ] }, "fedora-43": { "buildarch": [ "noarch" ] }, "fedora-44": { "buildarch": [ "noarch" ] }, "fedora-45": { "buildarch": [ "noarch" ] }, "fedora-rawhide": { "buildarch": [ "noarch" ] }, "rhel-10": { "buildarch": [ "noarch" ] }, "rhel-9": { "buildarch": [ "noarch" ] } }, "name": "syslog2cef", "epoch": null, "version": "0.4.2", "release": "1" } SRPMResults finished