NAME

DistLogEntry Module to manipulate distribution log entries.

SYNOPSIS

use DistLog;

my $entry=createDistLogEntry(event=>"REMOVE",
                             from=>"Store::RSyncSSH",
                             fromid=>1234,
                             fromhost=>1.2.3.4,
                             fromhostid=>0,
                             fromhostname=>"MyStorageServer";
                             fromloc=>"/somewhere/over/the/rainbow",
                             uid=>56
                            );

my $ref=parseDistLogEntry($entry);

DESCRIPTION

Module creating and manipulating distribution log entries in the correct way. createDistLogEntry is exported as default.

FUNCTIONS

createDistLogEntry()

create a proper distribution log entry based upon a set of parameter input.

Possible parameters are:

Returns a ready formatted string of the distribution log entry that can be given to the Log-service of AURORA upon success. Blank string upon failure.

The formatted string is in JSON format and looks like this:

[
   STRING, (SHORT-FORM INFO of the distlog event)
   {HASH} (HASH with all the key-value pairs of the event)
]

parseDistLogEntry()

Parses a textual distlog entry that has been created with the createDistLogEntry()-method.

Input parameter: DistLog-string

Returns the parsed JSON-data as a ARRAY-reference upon success, undef upon failure.

The format of the ARRAY-reference is the same as the JSON format, mentioned in createDistLogEntry.