#!/usr/bin/perl # Script to convert a logfiles produced by # Novell BorderManager Authentication Services (BMAS) RADIUS # into a standard "detail" file format suitable for RadiusReport. # Remember to change RadiusReport to use the Ascend date format specification # $RECORD_DATE_FMT = "YEAR-MON-MDAY HH:MM:SS"; # Program copyright 2001, Paul Gregg # Unauthorised redistribution prohibited. # http://www.pgregg.com $first = ""; @associations = (); while () { chomp; $cr = chr(13); s/$cr//ge; if ($first eq "") { $first = $_; @fields = split(/,/, $_); foreach $field (@fields) { $field =~ s/\"//g; push(@associations, $field); } $num_fields = $#associations + 1; } else { @fields = split(/,/, $_); foreach $field (@fields) { $field =~ s/\"//g; } printf ("%s %s\n", $fields[0], $fields[1]); for ($count=2; $count < $num_fields; $count++) { printf ("\t%s = %s\n", $associations[$count], $fields[$count]) if ($fields[$count] ne ""); } print "\n"; } }