Kibana index with custom attributes

Hi,

Is it possible to create costum attributes while creating kibana index pattern?
The goal is to be able to detect an index created with a Kubernetes Operator (among the others created by the Kibana GUI)

I tried doing it by running following command:

curl -k -X POST  --header "Content-Type: application/json"  --header "kbn-xsrf: true" -d  "{\"attributes\":{\"title\":\"ldhtest-log-*\",\"timeFieldName\":\"time\",\"createdByOperator:\":\"true\"}}" 

but this gives me an error saying:

{"message":"mapping set to strict, dynamic introduction of [createdByOperator:] within [index-pattern] is not allowed: [strict_dynamic_mapping_exception] mapping set to strict, dynamic introduction of [createdByOperator:] within [index-pattern] is not allowed","statusCode":400,"error":"Bad Request"}

Could you help me with this?

Best Regards
Akshat

Can you describe your usecase in more detail? What are you trying to accomplish by placing custom attributes on index pattern saved objects?

@Nathan_Reese
Thanks for your quick response.

To answer your query:
We create a Kubernetes Custom Resource which is kept by a Kubenetes Operator. The Operator creates the Kibana index pattern via the REST Api. Then if we get the kibana index Via RestAPI and if we have a specific tag in it, we are able to detect that it has been created progamatically and peform some action.
But if the kibana index pattern was created by the GUI then we are doing nothing.

This is the high level idea of why we are creating custom attributes.

-Akshat

It is not possible to tag saved objects but that is an enhancement that is being looked at. You can follow saved object improvements at https://github.com/elastic/kibana/issues/61716

Do you mean it is not possible to create indices with custom attribute names?

I do not believe you can not create Kibana saved objects with custom attributes.

Okay. So how can I do it?
Is there anything wrong in my command that I have mentioned above in the description?
If yes, what would be te right approach?
if no, then why the error(error mentioned in the issue description) and how can I resolve this error?

The error message is saying that strict mapping is applied so unknown fields can not be added to the saved object. What you are trying to do is not possible.

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