SyslogScan::ByGroup - Organizes a Summary of mail statistics into


SyslogScan documentation  | view source Contained in the SyslogScan distribution.

Index


NAME

Top

SyslogScan::ByGroup -- Organizes a Summary of mail statistics into Groups of related e-mail users

SYNOPSIS

Top

    # $summary is a SyslogScan::Summary object

    # default is to organize by internet host
    my $byGroup = new SyslogScan::ByGroup($summary);
    print $byGroup -> dump();

    # group by whether users use 'jupiter' or 'satellife' as
    # their machine name, and discard users who use neither

    my $pointerToGroupingRoutine = sub {
	my $address = shift;

        return 'jupiter' if $address =~ /jupiter.healthnet.org$/;
	return 'satellife' if $address =~ /satellife.healthnet.org$/;

	# ignore all others
	return undef;
    }

    my $groupByMachine = new SyslogScan::ByGroup($summary,
						 $pointerToGroupingRoutine);
    print $groupByMachine -> dump();

    # Extract a SyslogScan::Group object
    my $jupiterGroup = $$groupByMachine{jupiter};
    print $jupiterGroup -> dump();

    # Extract a SyslogScan::Summary object
    my $summaryOfJupiter = $jupiterGroup{byAddress};
    print $summaryOfJupiter -> dump();

    # Create a summary by group, rather than a summary by address
    my $summaryByMachine = $groupByMachine -> createSummary();

DESCRIPTION

Top

A SyslogScan::ByGroup object is a hash table of SyslogScan::Group objects, each indexed by the group name as returned by the sorting algorithm fed to 'new'.

A SyslogScan::Group is a hash table with two members: 'byAddress', which is a SyslogScan::Summary of each address which is a member of the Group, and 'groupUsage', which is a SyslogScan::Usage object containing the total usage of the group.

AUTHOR and COPYRIGHT

Top

SEE ALSO

Top

SyslogScan::Summary, SyslogScan::Usage


SyslogScan documentation  | view source Contained in the SyslogScan distribution.