Hello,
When I stream UDP data to Splunk using a script to pipe Apache access logs via scripts. The splunk server combines all of the session log data into one entry instead of separate entries, example entry:
4/20/11
11:42:06.000 AM
access_log[25674]: IP="172.168.5.4" HH="www.someweb.com" US=97947 RQ="GET / HTTP/1.1" ST=200 SZ=9102 CON="-" REF="-" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=90289
access_log[25675]: IP="172.168.5.4" HH="www.someweb.com" US=46385 RQ="GET /home/ HTTP/1.1" ST=200 SZ=9563 CON="-" REF="http://www.someweb.com/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=39386
access_log[25673]: IP="172.168.5.4" HH="www.someweb.com" US=44823 RQ="GET /family/ HTTP/1.1" ST=200 SZ=9335 CON="-" REF="http://www.someweb.com/someweb-home/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=36921
access_log[25679]: IP="172.168.5.4" HH="www.someweb.com" US=60747 RQ="GET /how_3391681_handle-unruly-children.html HTTP/1.1" ST=200 SZ=12685 CON="-" REF="http://www.someweb.com/someweb-family/" UA="ELinks/0.11.1 (textmode; Linux; 237x50-2)" PHP_TIME=53606
This is a simple perl script I'm using to stream Apache access logs via named pipe:
#!/usr/bin/perl
use IO::Socket;
my $server = $ARGV[0];
my $protocol = $ARGV[1];
my $port = $ARGV[2];
my $socket = IO::Socket::INET->new(PeerAddr => $server, PeerPort => $port, Proto => "$protocol", Type => SOCK_DGRAM);
$| = 1;
while ( <STDIN> ) {
chomp $_;
print $socket "$_\n";
}
In the apache config:
CustomLog "| /usr/local/bin/apache_pipe.pl 172.16.5.55 udp 4444" combine
When streaming UDP data, do the splunk servers need a special char or signal to indicate the line is finished and to add a new entry?
... View more