I am trying to use the rename processor with field: "level" and target_field: "log.level." I am getting this error:
"error": {
"type": "illegal_argument_exception",
"reason": "cannot set [level] with parent object of type [java.lang.String] as part of path [log.level]"
}
It appears this was fixed many years ago. Any ideas on what I'm doing wrong?
This is an example of what I'm trying to send:
{"@timestamp":"2024-08-09T03:24:13.709Z","container_name":"camera-service","source":"stdout","log":"{\"camera-service\":{\"service\":\"Repository\"},\"level\":\"debug\",\"message\":\"Finding by id 6681f65fbfbb2aa47f1be43e for collection gateways\",\"timestamp\":\"2024-08-09T03:24:13.709Z\"}"}
Looking at the linked issue and what you want to do, they are not the same problem.
The issue is about renaming a field into a nested field with the same parent name, as the example in issue shows, it is about being able to rename version into version.somethingElse.
What you want to do is to rename level into a nested field with a different parent name, so level into log.level.
If you change your rename processor to something like this, you will see that it works:
I was looking at the output of just the json processor to post here and spotted the root issue that you brought up haha.
I tried to add the processors to either remove the log field or rename it before renaming the level field, but am getting this error for both:
{
"error": {
"type": "document_parsing_exception",
"reason": "[1:229] failed to parse field [log] of type [text] in document with id 'y3KTNZEBT3Hv0nvc7Amv'. Preview of field's value: '{level=error}'",
"caused_by": {
"type": "illegal_state_exception",
"reason": "Can't get text on a START_OBJECT at 1:213"
}
}
}
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.