Skip to content

Instantly share code, notes, and snippets.

@ryands
Created February 6, 2012 17:49
Show Gist options
  • Save ryands/1753636 to your computer and use it in GitHub Desktop.
Save ryands/1753636 to your computer and use it in GitHub Desktop.
Strip ZNC playback from irssi logs
#!/usr/bin/perl
# Process logs for stats
my $znc_playback = 0;
while (my $line = <>) {
if($line =~ /^[0-9]{1,2}:[0-9]{1,2} < \*\*\*> Buffer Playback\.\.\.$/) {
$znc_playback = 1;
} elsif($line =~ /^[0-9]{1,2}:[0-9]{1,2} < \*\*\*> Playback Complete\.$/) {
$znc_playback = 0;
} else {
print $line unless $znc_playback;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment