<pre name="code" class="html">日期格式转换:
/***** nginx 访问日志
[elk@zjtest7-frontend config]$ cat stdin02.conf
input {
stdin {
}
}
filter {
grok {
match => ["message", "%{IPORHOST:clientip} \[%{HTTPDATE:time}\]"]
}
#date {
# match => ["time", "dd/MMM/yyyy:HH:mm:ss Z"]
#}
}
output {
stdout {
codec=>rubydebug{}
}
}
[elk@zjtest7-frontend config]$ ../bin/logstash -f stdin02.conf
Settings: Default pipeline workers: 1
Pipeline main started
10.171.246.184 [22/Sep/2016:00:13:59 +0800] "GET /resources/css/base.css?06212016 HTTP/1.1" - 200 12638 "https://www.zjcap.cn/"
{
"message" => " 10.171.246.184 [22/Sep/2016:00:13:59 +0800] \"GET /resources/css/base.css?06212016 HTTP/1.1\" - 200 12638 \"https://www.zjcap.cn/\" ",
"@version" => "
logstash 各种时间转换
最新推荐文章于 2023-11-22 10:28:47 发布