I'm trying to query the field value.value which is a json string from this struct in ElasticSearch.
I wrote this query to narrow down the search:
{
"query": {
"bool": {
"must": [
{
"term": {
"valueType": {
"value": "VARIABLE",
"boost": 1
}
}
},
{
"term": {
"intent": {
"value": "CREATED",
"boost": 1
}
}
},
{
"term": {
"recordType": {
"value":"EVENT",
"boost": 1
}
}
},
{
"term": {
"position": {
"value":16185492,
"boost": 1
}
}
}
]
}
}
"_source": true
}
But I cannot figure out how to get only record with, as example, ID_TRANSACTION=304 from field value.value. This field is a type keyword. Here the mapping:


Indeed, ideally we should have an ingest pipeline with a
jsonprocessor for parsing thevalue.valuecontent into specific fields that you can query.The problem, however, is that the mapping is defined with
dynamic: strictby Zeebe, which means that it won't be possible to add new fields in your document. Also it is not possible to usevalue.valueas an object containing the parsed JSON fields, becausevalue.valueis defined as akeywordand that cannot be changed.The only way to make this happen is to change the
record-variableindex template present in Zeebe in order to allow new fields to be created.If you have the rights to do it, or if you know someone who can do it for you, here is how to do it.
First, create an ingest pipeline to parse the JSON content in
value.valueinto separate fields that you can query:Then, modify the
zeebe-record-variable-template.jsonfile like this:When the next
zeebe-record_variable_8.2.12_*daily index will be created, it will have the new mapping using the new ingest pipeline that will parse thevalue.valuecontent and put it invalue.valueJsonthat you will be able to query.