Yes, you can do. Use heartbeat.yml to configure. This link may help you: https://www.elastic.co/guide/en/beats/heartbeat/current/configuring-howto-heartbeat.html
heartbeat.yml