# Logstash YML config, how it works?

**URL:** <https://discuss.elastic.co/t/logstash-yml-config-how-it-works/178014>\
**Category:** Logstash\
**Created:** [April 23, 2019, 10:59am UTC](https://discuss.elastic.co/t/logstash-yml-config-how-it-works/178014 "2019-04-23T10:59:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zanruin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zanruin/32/44301_2.png) [@Zanruin](https://discuss.elastic.co/u/Zanruin)\
**Post date:** [April 23, 2019, 10:59am UTC](https://discuss.elastic.co/t/logstash-yml-config-how-it-works/178014/1 "2019-04-23T10:59:54Z")

</div>

Hey guys,

Im newbie with ELK stack but i have some questions.  
I want to understand how does logstash works. I have a configuration inside conf.d for all my win servers. The clients of elk are win server that has winlogbeat.

`input {  
beats {  
port =\> 5044

# ssl =\> true

# ssl\_certificate =\> "/etc/pki/tls/certs/logstash.crt"

# ssl\_key =\> "/etc/pki/tls/private/logstash.key"

}  
}

filter {  
if [type] == "syslog" {  
grok {  
match =\> {  
"message" =\> "%{SYSLOGTIMESTAMP:syslog\_timestamp} %{SYSLOGHOST:syslog\_hostname} %{DATA:syslog\_program}(?:[%{POSINT:syslog\_pid}])?: %{GREEDYDATA:syslog\_message}"  
}  
add\_field =\> ["received\_at", "%{@timestamp}"]  
add\_field =\> ["received\_from", "%{host}"]  
}  
syslog\_pri { }  
date {  
match =\> ["syslog\_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]  
}  
}  
}

output {  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
}  
}

1. How Logstash knows to which configuration (yml) does it send it to?

2. When I send logs from my win server to the elk stack, I get many small shards that make my elk oom. How can i fix that? Should I change that in my winlogbeat or is a misconfig in the ELK server?

3. Does anyone has any configuration that might work good so i can see, and understand the code?

Thank for the help guys! 🙌🙌🙌

---

<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:** [May 21, 2019, 11:00am UTC](https://discuss.elastic.co/t/logstash-yml-config-how-it-works/178014/2 "2019-05-21T11:00:05Z")

</div>

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