# Facing issue in getting all the agent.hostname

**URL:** <https://discuss.elastic.co/t/facing-issue-in-getting-all-the-agent-hostname/216775>\
**Category:** Logstash\
**Created:** [January 28, 2020, 8:12am UTC](https://discuss.elastic.co/t/facing-issue-in-getting-all-the-agent-hostname/216775 "2020-01-28T08:12:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yash\_kumar\_shah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_kumar_shah/32/61517_2.png) [@yash\_kumar\_shah](https://discuss.elastic.co/u/yash_kumar_shah)\
**Post date:** [January 28, 2020, 8:12am UTC](https://discuss.elastic.co/t/facing-issue-in-getting-all-the-agent-hostname/216775/1 "2020-01-28T08:12:23Z")

</div>

Hi  
I have successfully setup elk stack version 7.5.2 and migrated one of my complete applications to send logs and get it to visualize on kibana. Now I am trying to onboard another application using filebeat and adding a field in the new application and sending logs to logstash in the same port but using if-else on the basis of the field and sending it on different index

The problem I am facing is I am sometimes getting few agents . hostname in kibana and something I am getting all plus there is sometimes a huge difference in the logs percentage

For reference I am sharing my logstash configuration :

input {  
beats {  
port =\> 5046  
}  
}

output {  
if [type] == "ProjectA" {  
elasticsearch {  
hosts =\> ["X.X.X.X"]  
index =\> "ProjectA-%{+YYYY.MM.dd}"  
}  
}  
if [type] == "ProjectB"{  
elasticsearch {  
hosts =\> ["X.X.X.X"]  
index =\> "ProjectB-%{+YYYY.MM.dd}"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 25, 2020, 8:12am UTC](https://discuss.elastic.co/t/facing-issue-in-getting-all-the-agent-hostname/216775/2 "2020-02-25T08:12:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
