I have an image file (PNG) that I want to display at the top of a dashboard. The image cannot be obtained by a URL, but, rather needs to be local in the Kibana deployment. I am using a Markdown widget with the following markup:
// ![DataIntegrity](/bundles/data_integrity.png)
This works fine if the Kibana optimization runs prior to the image file being copied into the optimize/bundles directory. If there is any change in configuration that triggers the optimization cycle when Kibana is restarted, the custom image file is lost from the optimize/bundle directory and thus I have a broken link for the widget.
Is there a specific location within the Kibana deployment where I can place this image file to survive an optimization cycle using this strategy?
If you checkout the Kibana repository there is a plugin generator you can use to get you started. You will want to checkout the branch (6.7) that corresponds to the version you are using:
Ok, here is how this could be accomplished with a plugin:
Checkout the Kibana 6.7 branch, since we're building a plugin for 6.7.1. More information on running Kibana locally for development can be found here
Use the plugin generator to create a plugin node scripts/generate_plugin.js static_assets. More information on the plugin generator can be found here. Say no to all options, as we won't need them for this example.
node scripts/generate_plugin.js static_assets
? Provide a short description Static Assets
? What Kibana version are you targeting? 6.7.1
? Should an app component be generated? No
? Should translation files be generated? No
? Should a hack component be generated? No
? Should a server API be generated? No
Initialized empty Git repository in /mnt/c/elastic/kibana-extra/static_assets/.git/
yarn run v1.15.2
$ node scripts/kbn bootstrap
Running [bootstrap] command from [/mnt/c/elastic/kibana]:
Found [28] projects:
...
Open the plugin in an editor ../kibana-extra/static_assets
Add the following line to the plugin definition in index.js: publicDir: resolve(__dirname, 'public'),
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.