<commit_before># The client writes long messages to UDP socket.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check that lines in file have 8192 bytes message length after the header.
# Check that lines in server have 8192 bytes line length.

use strict;
use warnings;
use Socket;

my $msg = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

our %args = (
    client => {
	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
	func => \&write_length,
	lengths => [ 8190..8193 ],
    },
    syslogd => {
	options => ["-u"],
	loggrep => {
	    $msg => 4,
	}
    },
    server => {
	# >>> <13>Jan 31 00:10:11 0123456789ABC...lmn
	loggrep => {
	    qr/^>>> .{8192}$/ => 4,
	},
    },
    file => {
	# Jan 31 00:12:39 localhost 0123456789ABC...567
	loggrep => {
	    qr/^.{8216}$/ => 1,
	    qr/^.{8217}$/ => 1,
	    qr/^.{8218}$/ => 2,
	},
    },
);

1;<commit_msg>Test a 9000 bytes message.<commit_after># The client writes long messages to UDP socket.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check that lines in file have 8192 bytes message length after the header.
# Check that lines in server have 8192 bytes line length.

use strict;
use warnings;
use Socket;

my $msg = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

our %args = (
    client => {
	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
	func => \&write_length,
	lengths => [ 8190..8193,9000 ],
    },
    syslogd => {
	options => ["-u"],
	loggrep => {
	    $msg => 5,
	}
    },
    server => {
	# >>> <13>Jan 31 00:10:11 0123456789ABC...lmn
	loggrep => {
	    qr/^>>> .{8192}$/ => 5,
	},
    },
    file => {
	# Jan 31 00:12:39 localhost 0123456789ABC...567
	loggrep => {
	    qr/^.{8216}$/ => 1,
	    qr/^.{8217}$/ => 1,
	    qr/^.{8218}$/ => 3,
	},
    },
);

1;
{'fraction_non_alphanumeric': 0.15648148148148147, 'fraction_numerical': 0.08888888888888889, 'mean_word_length': 2.9007220216606497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4351203', 'n_tokens_mistral': 966, 'n_tokens_neox': 785, 'n_words': 249}