diff --git a/pyproject.toml b/pyproject.toml index a9f533a..ac74111 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "detectmateperformance" description = "A Python package for DetectMate performance evaluation." requires-python = ">=3.12" license = "EUPL-1.2" -version="0.1.9" +version="0.1.10" dependencies = [ "levenshtein>=0.27.3", "numpy>=2.4.4", diff --git a/src/detectmateperformance/_templates/syslog_templates.txt b/src/detectmateperformance/_templates/syslog_templates.txt index 76cedbe..a927341 100644 --- a/src/detectmateperformance/_templates/syslog_templates.txt +++ b/src/detectmateperformance/_templates/syslog_templates.txt @@ -1,24 +1,39 @@ (<*>) CMD (<*>) +(CRON) info (No MTA installed, discarding output) +* Super-optimized for small spaces - read how we shrank the memory +...done. +<*> (read_packet_remainder) +<*> Configured +<*> DHCPv4 address <*> via <*> +<*> Gained IPv6LL +<*> IPv6 successfully enabled +<*> Killing process <*> (kill) with signal SIGKILL. +<*> Killing process <*> kill with signal <*> +<*>: Current command vanished from the unit file, execution of the command list won't be resumed. +<*>: Gained IPv6LL +<*>: Link is not managed by us +Changed host name to <*> Changed host name to host <*> Closed GnuPG cryptographic agent <*> Closed GnuPG cryptographic agent and passphrase cache access for web browsers Closed GnuPG cryptographic agent and passphrase cache restricted -Closed GnuPG network certificate management daemon. Closed GnuPG cryptographic agent and passphrase cache. +Closed GnuPG network certificate management daemon. Closed REST API socket for snapd user session agent. -Created slice User Slice of jhall +Created slice User Slice of <*> Detected architecture <*> Detected virtualization kvm Enumeration completed Grace period over, resuming full feature set (<*>) for DNS server <*> +IN DS <*> +Listening on GnuPG cryptographic agent (ssh-agent emulation). Listening on GnuPG cryptographic agent and passphrase cache access for web browsers Listening on GnuPG cryptographic agent and passphrase cache restricted +Listening on GnuPG cryptographic agent and passphrase cache. Listening on GnuPG network certificate management daemon Listening on REST API socket for snapd user session agent -Listening on GnuPG cryptographic agent (ssh-agent emulation). -Listening on GnuPG cryptographic agent and passphrase cache. -Network configuration changed trying to establish connection Negative trust anchors: <*> +Network configuration changed trying to establish connection Positive Trust Anchors Reached target <*> Received <*> from PID <*> @@ -27,7 +42,8 @@ Reexecuting Reloaded The Apache HTTP Server Reloading The Apache HTTP Server Reloading. -Removed slice User Slice of jhall +Removed slice User Slice of <*> +Started Authorization Manager. Started Clean php session files Started Cleanup of Temporary Directories Started Daily apt download activities @@ -42,9 +58,11 @@ Started Message of the Day Started Network <*> Started Network Service Started OpenBSD Secure Shell server -Started Session <*> of user jhall +Started Session <*> of user <*> +Started Ubuntu Advantage APT and MOTD Messages. Started User Manager for UID <*> Started udev Kernel Device Manager +Starting Authorization Manager... Starting Clean php session files... Starting Cleanup of Temporary Directories Starting Daily apt download activities @@ -60,10 +78,12 @@ Starting Message of the Day Starting Network <*> Starting Network Service Starting OpenBSD Secure Shell server +Starting Ubuntu Advantage APT and MOTD Messages... Starting User Manager for UID <*> Starting automatic crash report generation apport Starting udev Kernel Device Manager Startup finished in <*> +Stopped Authorization Manager. Stopped Flush Journal to Persistent Storage Stopped Journal Service Stopped LSB Record successful boot for GRUB @@ -75,6 +95,7 @@ Stopped User Manager for UID <*> Stopped target <*> Stopped target Basic System Stopped udev Kernel Device Manager +Stopping Authorization Manager... Stopping Flush Journal to Persistent Storage Stopping Journal Service Stopping LSB Record successful boot for GRUB @@ -87,23 +108,20 @@ Stopping automatic crash report generation apport Stopping udev Kernel Device Manager Super optimized for small spaces read how we shrank the memory Synchronized to time server <*> (<*>). +Timed out waiting for reply from <*> Using degraded feature set (UDP) for DNS server <*> Using system hostname <*> +[system] Activating via systemd: service name=<*> unit=<*> requested by <*> (uid=<*>> pid=<*> comm=<*> label=<*>) +cached <*> is <*> +dig: <*> is not a legal name (ran out of space) done -<*> Configured -<*> DHCPv4 address <*> via <*> -<*> Gained IPv6LL -<*> IPv6 successfully enabled +footprint of <*> to make it the smallest full K8s around. +forwarded <*> to <*> +https://ubuntu.com/blog/microk8s-memory-optimisation +lo: Link is not managed by us message repeated <*> times <*> +read_fd_with_timeout failed for client <*> read error = <*> +started daemon version <*> using authority implementation <*> version <*> system Reloaded configuration system Successfully activated <*> -user <*> service Killing process <*> kill with signal <*> -footprint of <*>> to make it the smallest full K8s around. -IN DS <*> -[system] Activating via systemd: service name=<*> unit=<*> requested by <*> (uid=<*>> pid=<*> comm=<*> label=<*>) -systemd <*> running in system mode. (<*>) -lo: Link is not managed by us -<*>: Link is not managed by us -<*>: Gained IPv6LL -Timed out waiting for reply from <*> -https://ubuntu.com/blog/microk8s-memory-optimisation \ No newline at end of file +systemd <*> running in system mode. (<*>) \ No newline at end of file diff --git a/src/detectmateperformance/metatada.py b/src/detectmateperformance/metatada.py index 53c50ea..6b7f8d3 100644 --- a/src/detectmateperformance/metatada.py +++ b/src/detectmateperformance/metatada.py @@ -7,6 +7,6 @@ __website__ = "https://aecid.ait.ac.at" __license__ = "EUPL-1.2" __status__ = "Development" -__version__ = "0.1.9" +__version__ = "0.1.10" __all__ = ['__authors__', '__contact__', '__copyright__', '__date__', '__deprecated__', '__website__', '__license__', '__status__', '__version__'] diff --git a/tests/test_c/test_message.cpp b/tests/test_c/test_message.cpp index c81948c..9c3ab18 100644 --- a/tests/test_c/test_message.cpp +++ b/tests/test_c/test_message.cpp @@ -428,3 +428,18 @@ TEST(ParsedMessagesTest, HardCases4) { EXPECT_EQ(result1->getElem(0).log_template, "data TLB error interrupt"); } + +TEST(ParsedMessagesTest, HardCases5) { + std::deque input = { + "VAR Killing process VAR (kill) with signal SIGKILL.", + }; + std::string log = "user@1002.service: Killing process 29 (kill) with signal SIGKILL."; + + Templates* templates = new Templates(input); + MatchTree* matcher = new MatchTree(templates); + + ParsedMessages* result1 = matcher->match_string(log); + EXPECT_EQ(result1->size(), 1); + EXPECT_EQ(result1->getElem(0).log_template, "VAR Killing process VAR kill with signal SIGKILL"); + +}