[2019-05-24T21:11:17,880][DEBUG][o.e.a.b.TransportShardBulkAction] [VM_0_17_centos] [springboot-logstash-2019.05.24][0] failed to execute bulk item (index) index {[springboot-logstash-2019.05.24][_doc][mV_36WoBWEbX7YrrlP54], source[{"@timestamp":"2019-05-24T13:12:57.691Z","thread_name":"http-nio-8080-exec-1","@version":"1","logger_name":"com.example.demo.MyLog","message":"{\"appName\":\"demo\",\"className\":\"HelloController\",\"methodName\":\"hello\"}","appName":"demo","port":19333,"level":"INFO","host":"111.203.45.2","className":"HelloController","methodName":"hello","level_value":20000}]}
org.elasticsearch.index.mapper.MapperParsingException: object mapping for [message] tried to parse field [message] as object, but found a concrete value
at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrNested(DocumentParser.java:363) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:465) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.parseValue(DocumentParser.java:596) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.innerParseObject(DocumentParser.java:407) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrNested(DocumentParser.java:381) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.internalParseDocument(DocumentParser.java:98) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:71) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:267) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:770) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:747) ~[elasticsearch-7.0.0.jar:
with this you get "appName" and "className"... as fields on their own.
so they won´t be nested under "message"
this means:
you will have the "message" field and all of those fields extracted with the json filter as fields on top level.
if you want to get something like [message][appName] and [message][className]...
then you can try the json filter with the option "target" => "message"
BUT if you try to put other logs inside this index which only have a "message" field with a normal value then it wont be logged.
yes this should delete the original message which is "key":"value" and create a "object":{"key":"value","key":value"}
I havent tried it but this should work.
or If you want to be more safe you can: mutate { rename => { "message" => "msg" } } json { source => "msg" target => "message" }
then you will have the msg field with the original event and the message should be an object
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.