Scripted Fields v. X-Axis


I have an index with some bad data in a date field. Where epoch_second was expected, epoch_millisecond was indexed instead.

I added a scripted field to provide a corrected value.

I created a new Area Chart visualization.

When I try to aggregate this field for my Y axis, the field shows up in the list of valid fields.

When I try to aggregate this field for my X axis, the field does not show up.



Is there any way around this? It will be a while before I can fix this field and would like to know how to improvise in a situation like this.

My Kibana is version 6.5.3.


Unfortunately, scripted fields cannot be used in the X-Axis because the X-Axis is what is being filtered on and scripted fields cannot be used for filtering/searching.

I would suggest using your scripted field script with the Update By Query API to fix your documents. With this API you can modify the documents using a painless script (should be similar to your scripted field). Keep in mind, that any new data being ingested will need to be updated as well. You can do this either at the source, or by using an Ingest Pipeline to cleanup data.

@joshdover _update_by_query to fix this field is something I'm planning on.

In SQL I would be able to select floor(x/1000) as x from t group by x which would aggregate on the field as it has been indexed but then return a "fixed" value for x. I suppose there is no way to do this for Kibana?


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