问题一:
今天打算用logstash的grok插件自定义日志格式,并将处理完的数据存放的Elasticsearch中,但是却在第一列ip地址匹配就报错了。
报错输出如下:
{
“message” => "192.168.1.51 - - [13/Jan/2020:19:59:26 +0800] “HEAD / HTTP/1.1” 403 - “-” “curl/7.29.0"”,
“@version” => “1”,
“@timestamp” => “2020-01-13T11:59:34.914Z”,
“offset” => 3690,
“count” => 1,
“fields” => nil,
“beat” => {
“hostname” => “ansible”,
“name” => “ansible”
},
“source” => “/var/log/httpd/access_log”,
“type” => “log”,
“input_type” => “log”,
“host” => “ansible”,
“tags” => [
[0] “beats_input_codec_plain_applied”,
[1] “_grokparsefailure” * #grok没有匹配到自定义格式*
]
}
进配置文件/etc/logstash/logstash.conf查看 #自己手动创建编写
filter {
grok {
match => {