I'm interested in programmatically creating a scripted field using Painless. Namely, I want to create a string type that is formatted as a URL. I can create the field without problem. I can also push the Kibana configuration via the create index-pattern API. However, I'd like to be able to template out the base URL into a Kibana config value. This way a user can just change the config value (or via a script) for their environment and not have to change the Painless script.
The only other option that I can think of is to template the index pattern on disk, render the template, and update the index pattern.
The baseUrl is configurable at install time. So what I'll need to do is run a Jinja2 engine or something on the index-pattern json file before uploading it via the API. It'd be super helpful to expose the parameter feature of Painless scripts in Kibana. I'm concerned how well a template engine will do on a JSON file with a quoted JSON string embedded, that contains template escapes {{ }}
No, I'm sorry but it doesn't because the value is URL encoded when passed into the URL template. I mean, sanitizing input is important, but it just doesn't work for the URL use case when you're trying to build a URI. As a workaround, I'll just template the index pattern offline and update when necessary.
If I want to make a feature requires for parameter support, do I do that via GitHub issues for kibana?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.