Can I use json input for metrics in a table?

Can I use json input for metrics in a table?

image

I want to indicate whether or not to check, depending on the value of the state field.
For example, if the state value is 1, I want ok,
and if the state value is 0, I want no.

here is elasticsearch aggregation...

kibana json input:
{
"script":"doc['state'].value == 1 ? 'OK' : 'NO'"
}

but kibana json input is error...
unknown key for a VALUE_STRING in [script]...

Is it possible with json input?
How can I write a script if possible?

Hey @Yungyoung_Ok, if you wish to use a "script_fields" in Elasticsearch, you'll want to use a Kibana Scripted Field.

After you create the Kibana Scripted Field, it will show up like a normal field in Discover and when creating a new Visualization.

I know scripted field uses a lot of memory.

Is there a way to use fields only in that graph with json input?

Is there a way to use fields only in that graph with json input?

Unfortunately, there is not.

I know scripted field uses a lot of memory.

Using it inline via JSON input vs a scripted field has very little difference in memory utilization. However, the scripted field is used more widely, perhaps when it's not needed, so I can see your point about it's impact on the memory utilization of the cluster. Would you mind opening up a feature request here and explaining your rationale?

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