Setting up beat.hostname in Metricbeat

0

I am super new to these concepts, I apologize if this is a silly thing. I am trying to visualize Metricbeat data on Grafana with Elasticsearch data source, all running locally, but unable to find where "beat.hostname" is added in Metricbeat config.

I have the latest version of both Grafana and Metricbeat and am following this article. In the "Create Dashboard" section, the author mentions that he used "beat.hostname=grafana" as the host name when installing Metricbeat. He then used it on the query editor field to pull out the data on Grafana dashboard.

But where do we set this up? I looked the two YAML files in the Metricbeat folder but there is nothing describing this.

Thanks a lot for your help!

@YemaneZewdu Welcome,

beat.hostname is no longer used in recent versions of the Elastic stack. The field has been converted to agent.name. But imho you should use host.name as host field. Can you find those fields in your data?

Thanks for your reply @willemdh

I didn't find host.name in both .yml files. Someone suggested me to look at name inside the metricbeat.yml file under General. Would it be that?

I used the value in Grafana but didn't get it to work so I was confused if it was the right one.

Thank you

Maybe try add host metadata, check https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html

Thank you. I'll try that.