Menu

#2 Open LDAP Time format

open
nobody
None
4
2001-04-16
2001-04-16
No

In an openldap log the time is writtten differrent from
a NS Log

The

# Calculating Session Start
$starttime = $firstline;
@dummy = split(/\]/,$starttime);
@dummy = split(/\[/,$dummy[0]);
$starttime = $dummy[1];
$startseconds = parsedate($starttime);

part could be replaced by something similar to this.

@tmp = split (/slapd/);
$openldap = scalar(@tmp);
# print "OPEN LDAP : $openldap\n";
if ($openldap > 1)
{
$tmp = $tmp[0];
$tmp =~ s/elrond//g;
print "$tmp\n";

my($unparsed_timestamp) = $tmp;
$timestamp = parsedate ($unparsed_timestamp);
}
else
{
@tmp = split (/\[/);
$tmp = $tmp[1];
@tmp = split (/]/,$tmp);
my($unparsed_timestamp) = $tmp[0];
$timestamp = parsedate ($unparsed_timestamp);
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB