当logstash尝试在elasticsearch.it中写入时,我收到此错误。创建索引但弹性搜索没有可用的数据。
Document contains at least one immense term in field="errormsg.keyword" (whose UTF8 encoding is longer than the max length 32766
这是我的pipeline.conf。
input {
file {
path => "c:/logstash.log"
start_position => "beginning"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => "previous"
}
}
}
filter {
grok{
match => { "message" => "%{TIME:timestamp} %{LOGLEVEL:LEVEL} %{GREEDYDATA:errormsg}" }
}
}
output {
if "ERROR" in [LEVEL]
{
elasticsearch {
hosts=>"localhost:9200"
}
}
stdout { codec => rubydebug }
}
--- curl -XGET localhost的输出:9200 / logstash / _mapping
{
logstash-2017.06.16: {
mappings: {
_default_: {
_all: {
enabled: true,
norms: false
},
dynamic_templates: [
{
message_field: {
path_match: "message",
match_mapping_type: "string",
mapping: {
norms: false,
type: "text"}}},
{
string_fields: {
match: "*",
match_mapping_type: "string",
mapping: {
fields: {
keyword: {
type: "keyword"}},
norms: false,
type: "text"}}}],
properties: {
@timestamp: {
type: "date",
include_in_all: false},
@version: {
type: "keyword",
include_in_all: false},
geoip: {
dynamic: "true",
properties: {
ip: {type: "ip"},
latitude: {
type: "half_float"},
location: {
type: "geo_point"},
longitude: {type: "half_float"}}}}},
logs: {
_all: {
enabled: true,
norms: false},
dynamic_templates: [
{message_field: {
path_match: "message",
match_mapping_type: "string",
mapping: {norms: false,type: "text"}}},
{string_fields: {
match: "*",match_mapping_type: "string",
mapping: {
fields: {
keyword: {
type: "keyword"}},
norms: false,
type: "text"}}}],
properties: {
@timestamp: {
type: "date",
include_in_all: false},
@version: {
type: "keyword",
include_in_all: false},
LEVEL: {
type: "text",
norms: false,
fields: {
keyword: {
type: "keyword"}}},
errormsg: {
type: "text",norms: false,
fields: {
keyword: {
type: "keyword"}}},
geoip: {dynamic: "true",
properties: {
ip: {type: "ip"},
latitude: {type: "half_float"},
location: {type: "geo_point"},
longitude: {type: "half_float"}}},
host: {type: "text",norms: false,
fields: {
keyword: {type: "keyword"}}},
message: {type: "text",norms: false},
path: {type: "text",norms: false,
fields: {
keyword: {
type: "keyword"}}},
tags: {type: "text",norms: false,
fields: {
keyword: {
type: "keyword"}}},
timestamp: {type: "text",norms: false,
fields: {
keyword: {
type: "keyword"}}}}}}}}
这是例如要解析的错误:
17:37:17,103 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web] Servlet.service()java.io.FileNotFoundException:
at org.thymeleaf.templateresource.ServletContextTemplateResource
at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.
17:37:17,104 ERROR.....
非常感谢你的帮助@xeraa