Hi is any chance to use defined scripted fields in vega visualization ?
Yes there is, depends on where you need it at. If you need it in the data call, which is what I assume you need? If so, you do your normal data call:
{
"name": "piepieces",
"url": {
"%context%": true,
"%timefield%": "@timestamp",
"index": "indexname",
"body": {
"size": 0,
"aggs": {
"sp": {
"terms": {
"script": {
"inline": "INSERT SCRIPT HERE",
"lang": "painless"
},
"size": 8, // how many results you want returned
"order": {"_count": "desc"},
"valueType": "string" //part of your script, this one is a string result
}
}
}
}
}
}
Let me know if that works.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.