Portál AbcLinuxu, 7. května 2025 17:16
<13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:10 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 291 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:12 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 286 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:14 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 283 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:16 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 274 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:18 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 282 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:20 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 298 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:22 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 305 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:24 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 285 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:26 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 286 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:28 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 282 <13>Sep 9 13:53:17 apache: web01.tld 192.168.10.1 - - [09/Sep/2015:13:57:30 +0200] "HEAD /check.txt HTTP/1.0" 200 - "-" "-" 287Přesně : Sep 9 13:53:17 apache: mi zde prekazi, pro dalsi zpracovani logu, to ze se mi log prenasi bez spravnych radku nalepeny za sebe mi pro ted netrapi. ve virtualhostu:
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" syslogformat CustomLog "|/usr/bin/logger -t 'apache' -u /var/log/apache_log.socket" syslogformatsyslog-ng client
options { flush_lines(0); time_reopen(5); log_fifo_size(1000); long_hostnames(off); use_dns(no); use_fqdn(no); create_dirs(yes); keep_hostname(yes); chain_hostnames(no); }; source s_apache { unix-stream("/var/log/apache_log.socket"); }; template t_send_syslog_template { template("$MSGHDR$MSG\n"); template_escape(no); }; destination d_loggly { udp("192.168.10.250" port(5140) template(t_send_syslog_template)); }; log { source(s_apache); destination(d_loggly); };syslog-ng server
options { flush_lines(0); time_reopen(5); log_fifo_size(1000); long_hostnames(off); use_dns(no); use_fqdn(no); create_dirs(yes); keep_hostname(yes); chain_hostnames(no); }; source s_syslog_in { udp(ip(0.0.0.0) port(5140) flags("no-multi-line","no-parse")); }; template t_log_template { template("$MSG\n"); template_escape(no); }; destination d_syslog_file { file("/var/log/apache2/log_-$YEAR-$MONTH-$DAY.log" template(t_log_template)); }; log { source(s_syslog_in); destination(d_syslog_file); };nemá nekdo podobnou zkusenost a nevedel by jak to resit ?
options { flush_lines(0); time_reopen(5); log_fifo_size(1000); long_hostnames(off); use_dns(no); use_fqdn(no); create_dirs(yes); keep_hostname(yes); chain_hostnames(no); }; source s_apache { unix-stream("/var/log/apache_log.socket" flags(no-parse)) ; }; destination d_loggly { udp("192.168.10.250" port(5140) template("$MGS\n")); }; log { source(s_apache); destination(d_loggly); };porad jsou pridavany prebytecne informace.
unix-stream("/var/log/apache_log.socket");Neslo by ten CustomLog definovat primo?
CustomLog /var/log/apache_log.socket syslogformat
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.