[Icecast] script to link error.log and access.log for the purpose of finding the name of a disconnected feed

Xabier Oneca -- xOneca xoneca+icecast at gmail.com
Mon Jul 8 09:53:56 UTC 2013


A source (and clients too) doesn't appear in access.log until it has
disconnected, so you can bypass the error.log file filtering. I usually use
the following command line for the same task:

$ grep SOURCE /var/log/access.log

--
Xabier Oneca_,,_
El 08/07/2013 11:19, "Rene Christensen Dokbua" <rene at dokbua.com> escribió:

>
> My humble contribution to the project. :)
>
> #!/usr/bin/perl -w
>
> open my $EL, "/var/log/icecast/error.log" || die;
>
> $| = 1;
>
> while(my $buf = <$EL>) {
>     if ($buf =~ /Disconnect/) {
>         $_ = $buf;
>         s/\[|\]//g;
>         my @tmp = split(/ +/);
>         my $time = $tmp[1];
>         open my $AL, "/var/log/icecast/access.log" || die;
>         my @lines = grep { /$time/ && /SOURCE/ } <$AL>;
>         close($AL);
>         print @lines;
>     }
> }
>
> close($EL);
>
>
>
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20130708/1af21732/attachment.htm>


More information about the Icecast mailing list