Fail to get kibana

Dears
I get this error messege when I trying to import the dashboard for winlogbeat in to kibana
error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://x.y.z.a:5601/api/status fails: fail to execute the HTTP GET request: Get http://x.y.z.a:5601/api/status: EOF. Response: .

Hi @talaat, welcome to the discussion boards!

Can you navigate to your Kibana instance directly by hitting the link that winlogbeat is trying to use (http://x.y.z.a:5601/api/status in your example)?

What version of Kibana and winlogbeat are you running? What does your kibana.yml and winlogbeat.yml configuration look like?

/api/status

{"name":"manager","uuid":"f50527da-2ee9-4c63-9b03-6604275adf21","version":{"number":"7.6.0","build_hash":"a39524c6f560abcdd8956721c87264b59ca65948","build_number":29000,"build_snapshot":false},"status":{"overall":{"state":"green","title":"Green","nickname":"Looking good","icon":"success","uiColor":"secondary","since":"2020-03-17T10:22:41.855Z"},"statuses":[{"id":"plugin:kibana@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.855Z"},{"id":"plugin:elasticsearch@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.862Z"},{"id":"plugin:wazuh@3.11.4","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.945Z"},{"id":"plugin:apm_oss@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.947Z"},{"id":"plugin:console@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.952Z"},{"id":"plugin:data@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.955Z"},{"id":"plugin:interpreter@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.960Z"},{"id":"plugin:input_control_vis@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.962Z"},{"id":"plugin:management@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.964Z"},{"id":"plugin:navigation@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.966Z"},{"id":"plugin:region_map@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.969Z"},{"id":"plugin:kibana_react@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:41.971Z"},{"id":"plugin:timelion@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.133Z"},{"id":"plugin:ui_metric@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.135Z"},{"id":"plugin:markdown_vis@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.136Z"},{"id":"plugin:metric_vis@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.138Z"},{"id":"plugin:table_vis@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.139Z"},{"id":"plugin:metrics@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.147Z"},{"id":"plugin:tagcloud@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.149Z"},{"id":"plugin:vega@7.6.0","state":"green","icon":"success","message":"Ready","uiColor":"secondary","since":"2020-03-17T10:22:42.150Z"}]},"metrics":{"last_updated":"2020-03-17T12:30:08.937Z","collection_interval_in_millis":5000,"process":{"memory":{"heap":{"total_in_bytes":133001216,"used_in_bytes":118391528,"size_limit":1526909922},"resident_set_size_in_bytes":180645888},"event_loop_delay":0.07228100020438433,"pid":2274,"uptime_in_millis":7760068},"os":{"load":{"1m":0.10009765625,"5m":0.07763671875,"15m":0.06298828125},"memory":{"total_in_bytes":3973304320,"free_in_bytes":152760320,"used_in_bytes":3820544000},"uptime_in_millis":7766000,"platform":"linux","platformRelease":"linux-3.10.0-957.5.1.el7.x86_64","distro":"Centos","distroRelease":"Centos-7.7.1908","cgroup":{"cpuacct":{"control_group":"/","usage_nanos":305602061147},"cpu":{"control_group":"/","cfs_period_micros":100000,"cfs_quota_micros":-1,"stat":{"number_of_elapsed_periods":0,"number_of_times_throttled":0,"time_throttled_nanos":0}}}},"response_times":{"max_in_millis":0},"requests":{"disconnects":0,"statusCodes":{},"total":0,"status_codes":{}},"concurrent_connections":0}}

kibana.yml is

server.host: "x.y.z.a"
server.ssl.enabled: true
server.ssl.key: /etc/kibana/kibana.key
server.ssl.certificate: /etc/kibana/kibana.cert
telemetry.enabled: false

winlogbeat.yml

###################### Winlogbeat Configuration Example ########################

# This file is an example configuration file highlighting only the most common
# options. The winlogbeat.reference.yml file from the same directory contains
# all the supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/winlogbeat/index.html

#======================= Winlogbeat specific options ===========================

# event_logs specifies a list of event logs to monitor as well as any
# accompanying options. The YAML data type of event_logs is a list of
# dictionaries.
#
# The supported keys are name (required), tags, fields, fields_under_root,
# forwarded, ignore_older, level, event_id, provider, and include_xml. Please
# visit the documentation for the complete details of each option.
# https://go.es.io/WinlogbeatConfig
winlogbeat.event_logs:
  - name: Application
    ignore_older: 72h

  - name: System

  - name: Security
    processors:
      - script:
          lang: javascript
          id: security
          file: ${path.home}/module/security/config/winlogbeat-security.js

  - name: Microsoft-Windows-Sysmon/Operational
    processors:
      - script:
          lang: javascript
          id: sysmon
          file: ${path.home}/module/sysmon/config/winlogbeat-sysmon.js

#==================== Elasticsearch template settings ==========================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false


#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging


#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
setup.dashboards.enabled: true

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
# setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: https://10.1.106.5:5601

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:
  
#============================= Elastic Cloud ==================================

# These settings simplify using Winlogbeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
 # Array of hosts to connect to.
  hosts: ["10.1.106.5:9200"]

  # Protocol - either `http` (default) or `https`.
  # protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  # username: "elastic"
  # password: "changeme"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  # hosts: ["10.1.106.5:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

#================================ Processors =====================================

# Configure processors to enhance or manipulate events generated by the beat.

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

#============================== X-Pack Monitoring ===============================
# winlogbeat can export internal metrics to a central Elasticsearch monitoring
# cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#monitoring.enabled: false

# Sets the UUID of the Elasticsearch cluster under which monitoring data for this
# Winlogbeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
#monitoring.cluster_uuid:

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well.
# Note that the settings should point to your Elasticsearch *monitoring* cluster.
# Any setting that is not set is automatically inherited from the Elasticsearch
# output configuration, so if you have the Elasticsearch output configured such
# that it is pointing to your Elasticsearch monitoring cluster, you can simply
# uncomment the following line.
#monitoring.elasticsearch:

#================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true

Please use proper formatting to make your post readable in the future. I've edited your response this time.

To clarify:
It looks like you have ssl enabled for Kibana, but your post mentions connecting over http, rather than https. Do you in fact have ssl enabled?

Is winlogbeat setup to trust the certificates that Kibana is presenting? You may need to configure these settings in winlogbeat.yml as described here: https://www.elastic.co/guide/en/beats/winlogbeat/current/setup-kibana-endpoint.html#_setup_kibana_ssl_enabled

thanks Larry for your effort.

I did those configuration but give this error : error loading config file: yaml: line 118: did not find expected key

Please post your full yml config so I can help. Sounds like a parsing error

###################### Winlogbeat Configuration Example ########################

# This file is an example configuration file highlighting only the most common
# options. The winlogbeat.reference.yml file from the same directory contains
# all the supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/winlogbeat/index.html

#======================= Winlogbeat specific options ===========================

# event_logs specifies a list of event logs to monitor as well as any
# accompanying options. The YAML data type of event_logs is a list of
# dictionaries.
#
# The supported keys are name (required), tags, fields, fields_under_root,
# forwarded, ignore_older, level, event_id, provider, and include_xml. Please
# visit the documentation for the complete details of each option.
# https://go.es.io/WinlogbeatConfig
winlogbeat.event_logs:
  - name: Application
    ignore_older: 72h

  - name: System

  - name: Security
    processors:
      - script:
          lang: javascript
          id: security
          file: ${path.home}/module/security/config/winlogbeat-security.js

  - name: Microsoft-Windows-Sysmon/Operational
    processors:
      - script:
          lang: javascript
          id: sysmon
          file: ${path.home}/module/sysmon/config/winlogbeat-sysmon.js

#==================== Elasticsearch template settings ==========================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false


#================================ General =====================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging


#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
setup.dashboards.enabled: true

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
# setup.dashboards.url:

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: https://10.1.106.5:5601
  ssl.enabled: true
  ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
  ssl.certificate: "/etc/pki/client/cert.pem"
  ssl.key: "/etc/pki/client/cert.key
  
  

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:
  
#============================= Elastic Cloud ==================================

# These settings simplify using Winlogbeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
 # Array of hosts to connect to.
  hosts: ["10.1.106.5:9200"]

  # Protocol - either `http` (default) or `https`.
  # protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  # username: "elastic"
  # password: "changeme"

#----------------------------- Logstash output --------------------------------
#output.logstash:
  # The Logstash hosts
  # hosts: ["10.1.106.5:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

#================================ Processors =====================================

# Configure processors to enhance or manipulate events generated by the beat.

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

#============================== X-Pack Monitoring ===============================
# winlogbeat can export internal metrics to a central Elasticsearch monitoring
# cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#monitoring.enabled: false

# Sets the UUID of the Elasticsearch cluster under which monitoring data for this
# Winlogbeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
#monitoring.cluster_uuid:

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well.
# Note that the settings should point to your Elasticsearch *monitoring* cluster.
# Any setting that is not set is automatically inherited from the Elasticsearch
# output configuration, so if you have the Elasticsearch output configured such
# that it is pointing to your Elasticsearch monitoring cluster, you can simply
# uncomment the following line.
#monitoring.elasticsearch:

#================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true

Please use proper formatting to make your post readable in the future. I had to edit your post again.

This is missing its end quote. Should read:

ssl.key: "/etc/pki/client/cert.key"

sorry Larry,

I don't know how format .

I adjust " but give this error :
: Exiting: error connecting to Kibana: fail to load the TLS config: 2 errors: open /etc/pki/client/cert.pem: The system cannot find the path specified. /etc/pki/client/cert.pem; open /etc/pki/root/ca.pem: The system cannot find the path specified. reading /etc/pki/root/ca.pem

Sorry, if you surround your yml or logs with ``` , it will allow you to format.

Ex:
```
name: value
```

Becomes

name: value

Reading your error message:

errors: open /etc/pki/client/cert.pem: The system cannot find the path specified. /etc/pki/client/cert.pem; open /etc/pki/root/ca.pem: The system cannot find the path specified. reading /etc/pki/root/ca.pem

Tells me that the files you specified don't exist at the location you indicated

Dear Larry ,

if I want to import dashboard and access kibana through http instead of https ,how achieve that?

If you don't want to use https, then you can set server.ssl.enabled: false in your kibana.yml

'Dear Larry',
thanks for your effort.
'dashboard is already loaded through winlogbeat but when I display dashboard in kibana give me this error' :
'fetching fields for index pattern winlogbeat-* (ID: winlogbeat-*)
Not Found'