Beats: install dashboard in custom Space

Hi there,
I want to install from the command line kibana dashboards into custom Spaces.
The installation in Ubuntu into the default space it works like this:
./metricbeat -c /etc/metricbeat/metricbeat.yml setup -E setup.kibana.host=127.0.0.1:5601 -E setup.kibana.username=kibana -E setup.kibana.password=password

..and I thought for a custom space it would look like this:
./metricbeat -c /etc/metricbeat/metricbeat.yml setup -E setup.kibana.host=127.0.0.1:5601 -E setup.kibana.username=kibana -E setup.kibana.password=password -E setup.kibana.space.id=Dummy

...but it does not work :frowning:
Does someone has a solution for this?
Thank you and kind regards
Stefano

1 Like

What exactly doesn't work? Does it install the dashboard in the default space or is it something else?
Does the space exist already?

Hello Joe,
thanks for asking. First of all the custom space called Dummy already exists. Installing the dashboards does work when done without specifying a space. This is done by the first example. The dashboards go into Default.
Now I am looking for a way to install the same dashboards in a fresh environment directly into a custom space - and not in the first place into Default and then move them to Dummy. I put together some pieces of information I found and came to the conclusion described above, but it does not work. From what I know this possibility is given (see the metricbeat.yml for exampel), but how does the command from the CLI look like? For this test I downloaded the metricbeat tar.gz, unpacked it and did the test from the bash.
kind regards
Stefano

My question was about what exactly "it does not work" mean? Are there errors in the logs?

This is what I get:
root@elasticAllInOne:/tmp/metricbeat-6.8.6-linux-x86_64# ./metricbeat -c /etc/metricbeat/metricbeat.yml setup -E setup.kibana.host=127.0.0.1:5601 -E setup.kibana.username=kibana -E setup.kibana.password=password -E setup.kibana.space.id=Dummy
Loaded index template
Loading dashboards (Kibana must be running and reachable)
Exiting: fail to create the Kibana loader: Error creating Kibana client: Error creating Kibana client: fail to get the Kibana version: HTTP GET request to /api/status fails: . Response: {"statusCode":404,"error":"Not Found","message":"Not Found"}.
root@elasticAllInOne:/tmp/metricbeat-6.8.6-linux-x86_64#
root@elasticAllInOne:/tmp/metricbeat-6.8.6-linux-x86_64# ./metricbeat -c /etc/metricbeat/metricbeat.yml setup -E setup.kibana.host=127.0.0.1:5601 -E setup.kibana.username=kibana -E setup.kibana.password=password
Loaded index template
Loading dashboards (Kibana must be running and reachable)
Loaded dashboards
root@elasticAllInOne:/tmp/metricbeat-6.8.6-linux-x86_64#
best regards
Stefano

Thanks, that helps. A couple questions:

  • Can you access the /api/status URL of your Kibana instance manually via curl?
  • Did you set a custom server.basePath in your kibana.yml?
  • What version of Kibana are you running?

Hello Joe,
here are my results:

  1. curl -s -k -u elastic:password -XGET https://localhost:5601/api/status works fine{"name":"elasticAllInOne","uuid":"1c21942a-d0f8-49f9-8b09-4a9ff65a37e4","version":{"number":"6.8.6","build_hash":"a174acf677e77d280e3cbbbd8ffb6eca6db80846","build_number":20500,"build_snapshot":false}...
  2. No, I did not. Here is the kibana.yml
    # Kibana is served by a back end server. This setting specifies the port to use.
    #server.port: 5601

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
#server.host: "localhost"

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the server.rewriteBasePath setting to tell Kibana if it should remove the basePath
# from requests it receives, and to prevent a deprecation warning at startup.
# This setting cannot end in a slash.
#server.basePath: ""

# Specifies whether Kibana should rewrite requests that are prefixed with
# server.basePath or require that they are rewritten by your reverse proxy.
# This setting was effectively always false before Kibana 6.3 and will
# default to true starting in Kibana 7.0.
#server.rewriteBasePath: false

# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576

# The Kibana server's name. This is used for display purposes.
#server.name: "your-hostname"

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["https://127.0.0.1:9200"]

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
# that connects to this Kibana instance.
#elasticsearch.preserveHost: true

# Kibana uses an index in Elasticsearch to store saved searches, visualizations and
# dashboards. Kibana creates a new index if the index doesn't already exist.
#kibana.index: ".kibana"

# The default application to load.
#kibana.defaultAppId: "home"

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
elasticsearch.username: "kibana"
elasticsearch.password: password

# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.
# These settings enable SSL for outgoing requests from the Kibana server to the browser.
server.ssl.enabled: true
server.ssl.certificate: /etc/kibana/instance/instance.crt
server.ssl.key: /etc/kibana/instance/instance.key

# Optional settings that provide the paths to the PEM-format SSL certificate and key files.
# These files validate that your Elasticsearch backend uses the same key files.
#elasticsearch.ssl.certificate: /path/to/your/client.crt
elasticsearch.ssl.key: /etc/kibana/instance/instance.key

# Optional setting that enables you to specify a path to the PEM file for the certificate
# authority for your Elasticsearch instance.
elasticsearch.ssl.certificate: /etc/kibana/instance/instance.crt

# To disregard the validity of SSL certificates, change this setting's value to 'none'.
elasticsearch.ssl.verificationMode: certificate

# Time in milliseconds to wait for Elasticsearch to respond to pings. Defaults to the value of
# the elasticsearch.requestTimeout setting.
#elasticsearch.pingTimeout: 1500

# Time in milliseconds to wait for responses from the back end or Elasticsearch. This value
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# List of Kibana client-side headers to send to Elasticsearch. To send no client-side
# headers, set this value to [] (an empty list).
#elasticsearch.requestHeadersWhitelist: [ authorization ]

# Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
# by client-side headers, regardless of the elasticsearch.requestHeadersWhitelist configuration.
#elasticsearch.customHeaders: {}

# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying.
#elasticsearch.startupTimeout: 5000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /var/run/kibana.pid

# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout

# Set the value of this setting to true to suppress all logging output.
#logging.silent: false

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
#ops.interval: 5000

# Specifies locale to be used for all localizable strings, dates and number formats.
#i18n.locale: "en"
server.host: "0.0.0.0"
logging.dest: /var/log/kibana/kibana.log
elasticsearch.ssl.certificateAuthorities: /etc/kibana/ca/ca.crt
3) The cluster & agent version are 6.8.6
cheers
Stefano

Hi there,
the solution is to use this statement:
./metricbeat -c /etc/metricbeat/metricbeat.yml setup -E setup.kibana.host=127.0.0.1:5601 -E setup.kibana.username=kibana -E setup.kibana.password=password -E setup.kibana.space.id=dummy
The Space name has to be in lower case.
Reason:
It has to be the equal to the Space id e.g. refelceted in the URL of that space.
cheers and thanks
Stefano

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