Error trying to import dashboards to kibana with filebeat

Hello everyone,

I would like to ask if somebody know how I could import my dashboards directly with filebeat. When I do the procedure manually within the kibana page with import/export It works fine, yet when I set (setup.dashboards.file: , and/or setup.dashboards.enabled: true) in the filebeat.yml configuration file, it does not work and shows me the following error:

"2020-05-12T17:41:08.248+0200 ERROR instance/beat.go:933 Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana: Failed to import dashboard: Failed to load directory /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard: error loading /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard/dashboard_orders.json: fail to unmarshal the dashboard content from file /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard/dashboard_orders.json: invalid character '{' after top-level value
Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana: Failed to import dashboard: Failed to load directory /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard:
error loading /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard/dashboard_orders.json: fail to unmarshal the dashboard content from file /home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard/dashboard_orders.json: invalid character '{' after top-level value"

My dashboards are in the filebeat folder path
"/home/jdbricenoguerrero/Downloads/elk_trial/filebeat-7.6.2-linux-x86_64/kibana/7/dashboard/ " I have there my two dashboards that I wish to import, they are ".json" , and the other ".ndjson".

I have been trying several combinations in the within the filebeat.yml file (zipping the files, changing that path locations... etc, setup.dashboard.directory....), but I have not been able to import them.

Could somebody please try to help me??? , I also read the webpages "https://www.elastic.co/guide/en/beats/filebeat/current/load-kibana-dashboards.html", "https://www.elastic.co/guide/en/beats/filebeat/current/configuration-dashboards.html"
but it does not help that much.

Thanks in advance for any suggestion,

Juan David Briceno Guerero

Hey @nb03briceno,

Dashboards used by filebeat setup are not in the same format as the ones exported from Kibana. To export dashboards for filebeat setup you must use the filebeat export dashboard command.

Hello jsoriano,

Unfortunately after reading the article in : "https://www.elastic.co/guide/en/beats/devguide/current/export-dashboards.html" (to understand better your recommendation), I was not able to export dashboards by using filbeat.

Woud you mind giving me a piece of an example?, or explainning me how it works?. There is litle information about this topic in internet and the elasticsearch page (i think it is not easy to figure out how it works).

Cordially,

JUAN DAVID BRICENO GUERRERO

Hey @nb03briceno,

To export a dashboard you will need its id, it can be found in the URL of the dashboard when you visualize it in Kibana. It is usually a string like this one: 7fea2930-478e-11e7-b1f0-cb29bac6bf8b.

Then you need to run the command:

filebeat export dashboard -id 7fea2930-478e-11e7-b1f0-cb29bac6bf8b > somefile.json

Filebeat will need the configuration for the kibana endpoint, for example if you need to specify the host, you can add the option to the previous command:

filebeat export dashboard -id 7fea2930-478e-11e7-b1f0-cb29bac6bf8b -E setup.kibana.host="http://somehost:5601" > somefile.json

Excuse so much jsoriano,

This information is valuable. Do you in the case of dashboard importing, how I could achieve it from files that are in an url repository such as gitlab?. We already import by modifying the setup.dashboard.directory in the yml file, but we are not able to achieve it with the option "setup.dashboard.url " pointing towards the repository".

Thanks so much,

Juan David Briceno Guerrero
Master Student in Sustainable Industrial Engineering

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