Elasticsearch创建索引错误

时间:2016-05-20 15:34:00

标签: json elasticsearch logstash

我尝试使用以下方法在elasticsearch中创建索引:



curl -XPOST 'http://localhost:9200/filebeat-2016.05.19?pretty' -d '{
    "settings" : {
        "number_of_shards" : 5,
        "number_of_replicas" : 2
    },
    "mappings" : {
        "middleware-log" : {
            "properties" : {
               "date" : { "type" : "string","index" : "not_analyzed" } ,
                "source":{"index":"not_analyzed", "type":"string"},
                "error":{"index":"not_analyzed", "type":"string"},
                "type":{"index":"not_analyzed", "type":"string"},
                "cause_msg":{"index":"not_analyzed", "type":"string"},
                "sec":{"index":"not_analyzed", "type":"string"},
                "AlertType":{"index":"not_analyzed", "type":"string"},
                "exception_info":{"index":"not_analyzed", "type":"string"}
            }
        }
    }
}'




然而它会引发错误:



{
  "error" : {
    "root_cause" : [ {
      "type" : "mapper_parsing_exception",
      "reason" : "Root mapping definition has unsupported parameters:  [date : {mapping={date={index=not_analyzed, type=string}}, full_name=date}] [source : {mapping={source={index=not_analyzed, type=string}}, full_name=source}] [error : {mapping={error={index=not_analyzed, type=string}}, full_name=error}] [type : {mapping={type={index=not_analyzed, type=string}}, full_name=type}] [cause_msg : {mapping={cause_msg={index=not_analyzed, type=string}}, full_name=cause_msg}] [sec : {mapping={sec={index=not_analyzed, type=string}}, full_name=sec}] [AlertType : {mapping={AlertType={index=not_analyzed, type=string}}, full_name=AlertType}] [exception_info : {mapping={exception_info={index=not_analyzed, type=string}}, full_name=exception_info}] [geoip.location : {mapping={location={type=geo_point}}, full_name=geoip.location}] [@version : {mapping={@version={index=not_analyzed, type=string}}, full_name=@version}] [host : {mapping={host={index=not_analyzed, type=string}}, full_name=host}] [messageText : {mapping={messageText={index=not_analyzed, type=string}}, full_name=messageText}] [offset : {mapping={offset={type=long}}, full_name=offset}] [cause_type : {mapping={cause_type={index=not_analyzed, type=string}}, full_name=cause_type}] [count : {mapping={count={type=long}}, full_name=count}] [input_type : {mapping={input_type={index=not_analyzed, type=string}}, full_name=input_type}] [message : {mapping={message={type=string}}, full_name=message}] [serviceName : {mapping={serviceName={index=not_analyzed, type=string}}, full_name=serviceName}] [tags : {mapping={tags={index=not_analyzed, type=string}}, full_name=tags}] [beat.name : {mapping={name={index=not_analyzed, type=string}}, full_name=beat.name}] [beat.hostname : {mapping={hostname={index=not_analyzed, type=string}}, full_name=beat.hostname}] [@timestamp : {mapping={@timestamp={format=strict_date_optional_time||epoch_millis, type=date}}, full_name=@timestamp}] [cause_info : {mapping={cause_info={index=not_analyzed, type=string}}, full_name=cause_info}] [exception_type : {mapping={exception_type={index=not_analyzed, type=string}}, full_name=exception_type}] [exception_msg : {mapping={exception_msg={index=not_analyzed, type=string}}, full_name=exception_msg}]"
    } ],
    "type" : "mapper_parsing_exception",
    "reason" : "Failed to parse mapping [middleware-log]: Root mapping definition has unsupported parameters:  [date : {mapping={date={index=not_analyzed, type=string}}, full_name=date}] [source : {mapping={source={index=not_analyzed, type=string}}, full_name=source}] [error : {mapping={error={index=not_analyzed, type=string}}, full_name=error}] [type : {mapping={type={index=not_analyzed, type=string}}, full_name=type}] [cause_msg : {mapping={cause_msg={index=not_analyzed, type=string}}, full_name=cause_msg}] [sec : {mapping={sec={index=not_analyzed, type=string}}, full_name=sec}] [AlertType : {mapping={AlertType={index=not_analyzed, type=string}}, full_name=AlertType}] [exception_info : {mapping={exception_info={index=not_analyzed, type=string}}, full_name=exception_info}] [geoip.location : {mapping={location={type=geo_point}}, full_name=geoip.location}] [@version : {mapping={@version={index=not_analyzed, type=string}}, full_name=@version}] [host : {mapping={host={index=not_analyzed, type=string}}, full_name=host}] [messageText : {mapping={messageText={index=not_analyzed, type=string}}, full_name=messageText}] [offset : {mapping={offset={type=long}}, full_name=offset}] [cause_type : {mapping={cause_type={index=not_analyzed, type=string}}, full_name=cause_type}] [count : {mapping={count={type=long}}, full_name=count}] [input_type : {mapping={input_type={index=not_analyzed, type=string}}, full_name=input_type}] [message : {mapping={message={type=string}}, full_name=message}] [serviceName : {mapping={serviceName={index=not_analyzed, type=string}}, full_name=serviceName}] [tags : {mapping={tags={index=not_analyzed, type=string}}, full_name=tags}] [beat.name : {mapping={name={index=not_analyzed, type=string}}, full_name=beat.name}] [beat.hostname : {mapping={hostname={index=not_analyzed, type=string}}, full_name=beat.hostname}] [@timestamp : {mapping={@timestamp={format=strict_date_optional_time||epoch_millis, type=date}}, full_name=@timestamp}] [cause_info : {mapping={cause_info={index=not_analyzed, type=string}}, full_name=cause_info}] [exception_type : {mapping={exception_type={index=not_analyzed, type=string}}, full_name=exception_type}] [exception_msg : {mapping={exception_msg={index=not_analyzed, type=string}}, full_name=exception_msg}]",
    "caused_by" : {
      "type" : "mapper_parsing_exception",
      "reason" : "Root mapping definition has unsupported parameters:  [date : {mapping={date={index=not_analyzed, type=string}}, full_name=date}] [source : {mapping={source={index=not_analyzed, type=string}}, full_name=source}] [error : {mapping={error={index=not_analyzed, type=string}}, full_name=error}] [type : {mapping={type={index=not_analyzed, type=string}}, full_name=type}] [cause_msg : {mapping={cause_msg={index=not_analyzed, type=string}}, full_name=cause_msg}] [sec : {mapping={sec={index=not_analyzed, type=string}}, full_name=sec}] [AlertType : {mapping={AlertType={index=not_analyzed, type=string}}, full_name=AlertType}] [exception_info : {mapping={exception_info={index=not_analyzed, type=string}}, full_name=exception_info}] [geoip.location : {mapping={location={type=geo_point}}, full_name=geoip.location}] [@version : {mapping={@version={index=not_analyzed, type=string}}, full_name=@version}] [host : {mapping={host={index=not_analyzed, type=string}}, full_name=host}] [messageText : {mapping={messageText={index=not_analyzed, type=string}}, full_name=messageText}] [offset : {mapping={offset={type=long}}, full_name=offset}] [cause_type : {mapping={cause_type={index=not_analyzed, type=string}}, full_name=cause_type}] [count : {mapping={count={type=long}}, full_name=count}] [input_type : {mapping={input_type={index=not_analyzed, type=string}}, full_name=input_type}] [message : {mapping={message={type=string}}, full_name=message}] [serviceName : {mapping={serviceName={index=not_analyzed, type=string}}, full_name=serviceName}] [tags : {mapping={tags={index=not_analyzed, type=string}}, full_name=tags}] [beat.name : {mapping={name={index=not_analyzed, type=string}}, full_name=beat.name}] [beat.hostname : {mapping={hostname={index=not_analyzed, type=string}}, full_name=beat.hostname}] [@timestamp : {mapping={@timestamp={format=strict_date_optional_time||epoch_millis, type=date}}, full_name=@timestamp}] [cause_info : {mapping={cause_info={index=not_analyzed, type=string}}, full_name=cause_info}] [exception_type : {mapping={exception_type={index=not_analyzed, type=string}}, full_name=exception_type}] [exception_msg : {mapping={exception_msg={index=not_analyzed, type=string}}, full_name=exception_msg}]"
    }
  },
  "status" : 400
}




有人可以帮我弄清楚这里有什么问题吗? 提前致谢。 维卡斯

0 个答案:

没有答案