# Logstash from multiple beats server

**URL:** <https://discuss.elastic.co/t/logstash-from-multiple-beats-server/323491>\
**Category:** Logstash\
**Created:** [January 19, 2023, 9:34am UTC](https://discuss.elastic.co/t/logstash-from-multiple-beats-server/323491 "2023-01-19T09:34:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasan.idriss](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@hasan.idriss](https://discuss.elastic.co/u/hasan.idriss)\
**Post date:** [January 19, 2023, 9:34am UTC](https://discuss.elastic.co/t/logstash-from-multiple-beats-server/323491/1 "2023-01-19T09:34:13Z")

</div>

hello every one,  
i am using logstash to receive data from multiple server using winlogbeats over the port 5044  
I want to create an index for each server based on the server name  
can some one provide me with the logstash filter and output template to use

---

<div class="post-metadata">

**Author:** ![hasan.idriss](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@hasan.idriss](https://discuss.elastic.co/u/hasan.idriss)\
**Post date:** [January 19, 2023, 12:08pm UTC](https://discuss.elastic.co/t/logstash-from-multiple-beats-server/323491/2 "2023-01-19T12:08:45Z")

</div>

I found the solution, to whom interested here is my config

```auto
filter {
   mutate {
               remove_field => ["[event][original]"]
       }
    if [host][hostname] == "the host name in the log " {
        mutate { add_field => { "[@metadata][indexPrefix]" => "hostname" } }
    }
      }
output{
    stdout { }
    if [@metadata][indexPrefix] {
      elasticsearch {
  .................     
      index => "%{[@metadata][indexPrefix]}-%{+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 16, 2023, 12:09pm UTC](https://discuss.elastic.co/t/logstash-from-multiple-beats-server/323491/3 "2023-02-16T12:09:33Z")

</div>

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