Can someone helps me with this Json input!

Hello there,

So i created an alias based on two indexes,
and am creating a visualization with that alias that have a metric (count),
what i want do is to make that metric works with documents from only one of indexes that i specify
is it possible to do with JSON input ? if no, there is any alternative to solve this problem

thanks in advance

Hello @Skander_Harrabi

This might be a good candidate for using scripted fields - Scripted fields | Kibana Guide [7.12] | Elastic

You could look at the value of the _index field and conditionally return a value based on it.


1 Like

Hello mattkime ,
Thanks for your time , but i think i cant use the scripted fields on count metric,
if i can please show me how if not , do you suggest another method ?

thanks again for advance :slight_smile:


You could use the sum metric instead.


1 Like

yes man thanks alot :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.