Elasticsearch template filter field

I would like to be able to select which field is used to perform a filter. Sort of like a reduced adhoc filter. For example:

The idea would be to be able to get results either by ip, hostname or serial and have the filterValue dropdown auto-populated. Then in the query you could write $filterField:$filterValue

However it appears that the substitution for $filterField does not work as the dropdown is never populated. Am I doing something wrong or is this not supported?


1 Like

looks like only the “query” property is interpolated, so template variables in the “field” property will require a code update

1 Like

Pull request sumbitted

I have the same question with you. however, in my case, the value is like that

so if you have solution for our case, please tell me.

many thanks

and other problem here the value doesn’t display correct in column name

Hello, I have 3 template variables are $source, $metricName, $groupBy as the picture

but in $metricName I want to show only the fields which has type is number and source.keyword=$source

but it doesnt work. Do you have any ideas for this situation???

Many thanks

Hii Torkel, may you give some example about code update ??
Many thanks