#!/usr/local/bin/perl

while (<>) {
    chop;
    ($target, $service, $status, $severity, $trustee, $trusted, $service_output, $text) = split(/\|/);
    if ($status eq "a" && $trustee && $trusted) {
	($junk, $trustee_host) = split(/@/, $trustee);
	($junk, $trusted_host) = split(/@/, $trusted);
print "$_\n" if ($trusted_host eq "");
	$pile{"$trustee_host trusts $trusted_host"} = 0;
    }
}

foreach $line (keys %pile) {
    print "$line\n";
}
