Getting error while trying to populate logstash data to kibana

Hi Folks,
I am newbie here, i am trying to populate logstash metric data into kibana through elasticsearch module but i am getting 404 error after running metricbeat -e command on logstash server where metricbeat is also installed, however kibana and elasticsearch are reachable from logstash server.
any help would be really appreciated.

Hi tomalter

This sound like a good question for our #elastic-stack:beats channel. I'd recommend to provide some more details, e.g. your configuration. because the solution to you problem might be hidden there.

Best,
Matthias

Hi matw
i have define elastcsearch, kibana,and logstash details (IP:Port) in metricbeat.yml file and enable logstash module through metricbeat enable command as per the kibana documentation. please find error message i am getting and please let me know if there is any discrepency with configuration.

Failed to connect to backoff(elasticsearch(http://localhost:9600)): Failed to parse JSON response: json: cannot unmarshal string into Go struct field .Version of type struct { Number string }
2020-09-29T08:16:02.834+0200 INFO pipeline/output.go:93 Attempting to reconnect to backoff(elasticsearch(http://localhost:9600)) with 4 reconnect attempt(s)
2020-09-29T08:16:09.200+0200 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":540,"time":{"ms":543}},"total":{"ticks":930,"time":{"ms":936},"value":930},"user":{"ticks":390,"time":{"ms":393}}},"handles":{"limit":{"hard":4096,"soft":1024},"open":6},"info":{"ephemeral_id":"31c5fed0-a1c2-45f1-94a8-a8d1f599a756","uptime":{"ms":33072}},"memstats":{"gc_next":8038672,"memory_alloc":5592112,"memory_total":72211760,"rss":27127808}},"libbeat":{"config":{"module":{"running":0},"reloads":1},"output":{"read":{"bytes":1895},"type":"elasticsearch","write":{"bytes":605}},"pipeline":{"clients":8,"events":{"active":56,"published":56,"retry":96,"total":56}}},"metricbeat":{"logstash":{"node":{"events":3,"failures":3},"node_stats":{"events":3,"failures":3}},"system":{"cpu":{"events":3,"success":3},"filesystem":{"events":4,"success":4},"fsstat":{"events":1,"success":1},"load":{"events":3,"success":3},"memory":{"events":3,"success":3},"network":{"events":6,"success":6},"process":{"events":26,"success":26},"process_summary":{"events":3,"success":3},"uptime":{"events":1,"success":1}}},"system":{"cpu":{"cores":8},"load":{"1":0.01,"15":0.05,"5":0.04,"norm":{"1":0.0013,"15":0.0063,"5":0.005}}}}}}
2020-09-29T08:16:09.415+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node_stats: 404 Not Found
2020-09-29T08:16:09.419+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node: 404 Not Found
2020-09-29T08:16:19.422+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node_stats: 404 Not Found
2020-09-29T08:16:19.425+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node: 404 Not Found
2020-09-29T08:16:29.413+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node: 404 Not Found
2020-09-29T08:16:29.417+0200 ERROR [logstash] elastic/elastic.go:117 HTTP error 404 in node_stats: 404 Not Found

hi

9600 is the port for monitoring Logstash, since this seems to be a elasticsearch error message, try to change to 9200 which is the default port for elasticsearch? anyway pls share you metricbeat.yml file if this doesn't work.

Thx & Best,
Matthias

Hi matw
i did changes in configuration as per your input but issue is still there. please find below metricbeat.yml configuration and also now metricbeat setup command to load kibana dashboard is also not working. please let me know if there is any discrepency in metricbeat configuration.

###################### Metricbeat Configuration Example #######################

This file is an example configuration file highlighting only the most common

options. The metricbeat.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/metricbeat/index.html

#========================== Modules configuration ============================

metricbeat.config.modules:

Glob pattern for configuration loading

path: ${path.config}/modules.d/*.yml

Set to true to enable config reloading

reload.enabled: false

Period on which files under path should be checked for changes

#reload.period: 10s

#==================== Elasticsearch template setting ==========================

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 CLI flag or the setup command.

#setup.dashboards.enabled: false

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: "...: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 metricbeat 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: ["...:9200"]

Enabled ilm (beta) to use index lifecycle management instead daily indices.

#ilm.enabled: false

Optional protocol and basic auth credentials.

#protocol: "https"
#username: "elastic"
#password: "changeme"

#----------------------------- Logstash output --------------------------------
output.logstash:

The Logstash hosts

hosts: ["localhost:9600"]

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: ~

#================================ 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: ["*"]

#============================== Xpack Monitoring ===============================

metricbeat 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.

#xpack.monitoring.enabled: true

Uncomment to send the metrics to Elasticsearch. Most settings from the

Elasticsearch output are accepted here as well. Any setting that is not set is

automatically inherited from the Elasticsearch output configuration, so if you

have the Elasticsearch output configured, you can simply uncomment the

following line.

#xpack.monitoring.elasticsearch:

Could you format you config as code like this

code

so you've configured you elasticsearch to *.* . *.* :9200? or did you replace the ip with stars manually?

you want to send metrics of logstash to elasticsearch, right? not to logstash, right?
Then you need to deactivate the logstash output, and configure the logstash module of metricbeat

Hope this helps,
Best,
Matthias

Hi Matw
i am using elastic ip in that section but i replace IP with stars just to hide my server details and yes i am trying to send metrics of logstash to elastic search so that data could be populated on kibana so please suggests me.

Please disable the logstash output, and use the metricbeat module in the way it is described here:

Thx & Best,
Matthias