# Health Check on FileBeats Instance from AWS NLB

**URL:** <https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 6, 2021, 6:56pm UTC](https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371 "2021-04-06T18:56:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravi342883](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi342883/32/74643_2.png) [@Ravi342883](https://discuss.elastic.co/u/Ravi342883)\
**Post date:** [April 6, 2021, 6:56pm UTC](https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371/1 "2021-04-06T18:56:12Z")

</div>

Hi All,

Could you please help with the below NLB configuration in AWS in-front of FileBeat Instance? When I tried to created the setup, the Target Group always shows unhealthy - Health checks failed.

**Requirement:**  
_1. Devices(over UDP) --\> 2.NLB --\> 3.FileBeat Server (EC2) --\> AWS MSK --\> LogStash --\> Elastic Cloud Elastic Search_

**1. Devices:**  
All the n/w devices, like router switches will be configured to send their logs to NLB endpoint over UDP

**2. NLB:**  
NLB should route the incoming UDP traffic to a ec2 instance where elastic filebeat agents are up and running.

**3. Filebeat Server(EC2)**  
Elastic Filebeat is configured to listen to NLB endpoint.

**NLB** : [LB-TST-SOC-LOC-FB-7bf90bf8d5c8f5f4.elb.eu-west-1.amazonaws.com](http://lb-tst-soc-loc-fb-7bf90bf8d5c8f5f4.elb.eu-west-1.amazonaws.com/)  
**Port** :TCP\_UDP: 53

**Input configuration in filebeats:**  
filebeat.inputs:

- type: udp  
enabled: true  
host: "[LB-TST-SOC-LOC-FB-7bf90bf8d5c8f5f4.elb.eu-west-1.amazonaws.com](http://lb-tst-soc-loc-fb-7bf90bf8d5c8f5f4.elb.eu-west-1.amazonaws.com/):53"  
max\_message\_size: 10KiB

Below error recorded in the filebeat log while starting the filebeat agent:  
**2021-04-06T16:50:38.547+0100 ERROR udp/input.go:102 Error running harvester: listen udp 10.178.2.97:53: bind: cannot assign requested address**

I could see the Target Group status as unhealthy - Health checks failed.

I have a query related to the FileBeat server running on the target.  
The health checks are configured as TCP. Is the filebeat capable of handling TCP health checks originating from the NLB ?  
Could you please help?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 6, 2021, 7:55pm UTC](https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371/2 "2021-04-06T19:55:31Z")

</div>

I think that your problem is that the AWS NLB can't do a health check using UDP, so you will need to do the health check using TCP or HTTP/HTTPS.

You can do that adding a TCP input that will be used only for this healthcheck, than in your target group you configure the health check to use this port.

Or you can try this [experimental feature](https://www.elastic.co/guide/en/beats/filebeat/7.12/http-endpoint.html) that exposes the metrics http endpoint, and use this endpoint as the target for the health check.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 6, 2021, 9:50pm UTC](https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371/3 "2021-04-06T21:50:15Z")

</div>

Please don't create multiple topics for the same question, let's continue the discussion in your original thread [AWS NLB config infront of FileBeats Instance](https://discuss.elastic.co/t/aws-nlb-config-infront-of-filebeats-instance/269065)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 6, 2021, 9:50pm UTC](https://discuss.elastic.co/t/health-check-on-filebeats-instance-from-aws-nlb/269371/4 "2021-04-06T21:50:19Z")

</div>


