<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/env perl

use strict;
use warnings;

my $bookkeeping;
my $flt = '[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?';
my $pflt = "($flt)";
my $prefix = '^\[([^: ]+)(?::loba:\(\d+\))? ' . $pflt . '\] \[proc/INFO\] ';
my $initmatch = $prefix . 'Initial load: ' . $pflt;
my $finalmatch = $prefix . 'Final load after (\d+):(\d+) iterations: ' . $pflt;;
my $plainmatch = $prefix . '\((\d+):(\d+)\) current load: ' . $pflt;

my %alldata = ();

while (&lt;&gt;) {
    chomp;
    if (m{$plainmatch} or m{$finalmatch}) {
        my $host = $1;
        my $data = {
            time     =&gt; $2,
            lb       =&gt; $3,
            comp     =&gt; $4,
            load     =&gt; $5,
        };
#        print STDERR "PUSH $host $data-&gt;{time} $data-&gt;{load} (plain/final)\n";
        push @{$alldata{$host}}, $data;
    } elsif (m{$initmatch}) {
        my $host = $1;
        my $data = {
            time     =&gt; $2,
            lb       =&gt; 0,
            comp     =&gt; 0,
            load     =&gt; $3,
        };
#        print STDERR "PUSH $host $data-&gt;{time} $data-&gt;{load} (init)\n";
        push @{$alldata{$host}}, $data;
    }
}

foreach my $host (sort(keys %alldata)) {
#    print STDERR "GOT \"$host\"\n";
    my $datalist = $alldata{$host};
    print "# $host\n";
    foreach my $data (@{$datalist}) {
        print "$data-&gt;{time} $data-&gt;{load}\n";
    }
    print "\n\n"
}
</pre></body></html>