80.82.78.38 [23/Sep/2016:05:36:18 +0800] "GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1" - 404 162 "-" "Mozilla" 0.000 -
需要补一刀;
%{IPORHOST:clientip} [%{HTTPDATE:time}] "%{WORD:verb} (?<http_url>S+)s+HTTP/%{NUMBER:httpversion}"s+-s+%{NUMBER:http_status_code}s+%{NUMBER:bytes}s+"-"s+"(?<http_user_agent>(S+))"s+(%{BASE16FLOAT:request_time})s+(%{IPORHOST:http_x_forwarded_for}|-)
echo '80.82.78.38 [23/Sep/2016:05:36:18 +0800] "GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1" - 404 162 "-" "Mozilla" 0.000 -' >>access.log
ArgumentError: comparison of String with 5 failed
>= at org/jruby/RubyComparable.java:155
>= at org/jruby/RubyString.java:1853
output_func at (eval):145
output_batch at /usr/local/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:293
each at org/jruby/RubyArray.java:1613
inject at org/jruby/RubyEnumerable.java:852
output_batch at /usr/local/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:287
worker_loop at /usr/local/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:232
start_workers at /usr/local/logstash-2.3.4/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:201
jrhwpt02:/var/log/nginx# echo '80.82.78.38 [23/Sep/2016:05:36:18 +0800] "GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1" - 404 162 "-" "Mozilla" 0.000 -' >>access.log
You have new mail in /var/spool/mail/root
{
"@version" => "1",
"@timestamp" => "2016-09-22T21:36:18.000Z",
"path" => "/data01/applog_backup/zjzc_log/zj-frontend02-access.2016-09-23",
"host" => "dr-mysql01.zjcap.com",
"type" => "zj_frontend_access",
"clientip" => "80.82.78.38",
"time" => "23/Sep/2016:05:36:18 +0800",
"verb" => "GET",
"http_url" => "http://www.baidu.com/cache/global/img/gs.gif",
"httpversion" => "1.1",
"http_status_code" => "404",
"bytes" => "162",
"http_user_agent" => "Mozilla",
"response_time" => 0.0,
"messager" => "zj_frontend_access 80.82.78.38 [23/Sep/2016:05:36:18 +0800] "GET http://www.baidu.com/cache/global/img/gs.gif HTTP/1.1" - 404 162 "-" "Mozilla" 0.000 -"
}
ok