Hello guys, I would like to know if it's possible to use metadata as an array like this:
"metadata": {
"MyList": [
"1",
"2",
"3",
"4"
],
"from": "60m"
}
and use it as a parameters for my input:
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"*test*"
],
"rest_total_hits_as_int": true,
"body": {
"size": 0,
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"from": "now-{{ctx.metadata.from}}",
"to": "now"
}
}
},
{
"terms": {
**"id": "{{ctx.metadata.MyList}}"**
}
}
]
}
},
"aggs": {
"entite": {
"terms": {
"field": "id.keyword"
}
}
}
}
}
}
}
I would like that to act the same as:
{
"terms": {
"id": [
"1",
"2",
"3",
"4"
],
}
But when i'm trying it, my terms is transformed to:
"terms": {
"id": "{0=1, 1=2, 2=3, 3=4}"
}
Do you have any idea, if it's possible? I would like to avoid to duplicate MyList inside a condition and inside the input.
Thanks in advance