Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Scripted fields incompatible with Elasticsearch/Kibana v8 #33

Open
Tracked by #35
fholzer opened this issue Oct 5, 2022 · 3 comments · May be fixed by #37
Open
Tracked by #35

Scripted fields incompatible with Elasticsearch/Kibana v8 #33

fholzer opened this issue Oct 5, 2022 · 3 comments · May be fixed by #37

Comments

@fholzer
Copy link

fholzer commented Oct 5, 2022

We're on version 7.x and the upgrade assistant gives the following output:

You have 1 index patterns (cf-http-*...) that use scripted fields. Scripted fields are deprecated and will be removed in future. Use runtime fields instead.

Issues reported by the upgrade assistant must fixed before upgrading to v8. Seems like multiple fields are scripted. That logic will likely need to be moved from scripted fields to either runtime fields or the ingest pipeline.

Reference:
https://www.elastic.co/de/blog/introducing-elasticsearch-runtime-fields
https://www.elastic.co/guide/en/elasticsearch/reference/7.17/runtime.html

@ejcx
Copy link
Contributor

ejcx commented Oct 13, 2022

Hi, this project is unfortunately not very active and we haven't accommodated for updates in elasticsearch or kibana. I'm not the maintainer of this project but if you have a pull request that addresses the issue I'd be more than happy to look at it.

This was referenced Nov 30, 2022
@fholzer
Copy link
Author

fholzer commented Dec 5, 2022

Memo to myself:
To extract scripted fields from exported kibana saved-object files, changing their data structure to the one used for dynamic fields:

jq '.[] | select(._type == "index-pattern")._source.fields | fromjson | reduce (.[] | select(.scripted == true)) as $i ({}; . += { ($i.name): { type: $i.type, script: { source: $i.script } } })' dashboards/dashboards.json

Note that the script field content still needs to be updated to use emit() as per docs. That's already done in #37

@penekk
Copy link

penekk commented Jan 13, 2023

I have managed to "migrate" this to runtime fields within index-template some time ago that I plan to start using soon - I decided to use https://github.com/elastic/terraform-provider-elasticstack for that. Once I find some time I could share those snippets, if you like. I do remember there were some challenges with reformatting everything so that you can push the json properly but still maintain some readability of .tf files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants