How to define scripted fields using scripts

I have more than 10 scriped fields in kibana. i want to define each and every scripted field as we do in kibana but using some python or shell scripts. How can i achieve that?

Thank You,
Meet

I don't know specifically for python but here is the REST call: https://www.elastic.co/guide/en/elasticsearch/reference/6.2/search-request-script-fields.html

Currently i have 10 painless scripts in txt files and some visualizations and dashboards in json file. I want to create one simple script which automatically creates index-pattern, upload json files for visualizations and dashboards and define scripted fields specified in txt files.

If there is no way to define index-pattern and upload json files using script that is okay. But i want to automate this adding scripted fields so that there is no need to define each and every fields using kibana interface

So it's a Kibana question. Moving it to #kibana

You could do this REST call after having created a scripted field in Kibana UI:
GET .kibana/_search
This will show you how the scripted fields are stored in the index pattern document. You can then edit that document with all the scripted fields you wish to add and then update the document in Elasticsearch.

Thanks

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