# How to separate devices/logfiles

**URL:** <https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325>\
**Category:** Logstash\
**Created:** [May 19, 2020, 1:13pm UTC](https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325 "2020-05-19T13:13:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ELK212](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@ELK212](https://discuss.elastic.co/u/ELK212)\
**Post date:** [May 19, 2020, 1:13pm UTC](https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325/1 "2020-05-19T13:13:56Z")

</div>

Hello,

I just want to know how a logical separation should/could look like for different types of devices.

Let's say I have a bunch of switches and a bunch of servers which can send syslog messages.  
How should I separate them in Elasticsearch (two groups: switches and servers)? How could this look like in the logstash configuration? Are there any guidelines?

Is there any function I can group devices? Maybe lets say all devices in a specific range will get index "X" and other ones get index "Y"?

Regards  
ELK212

---

<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:** [May 19, 2020, 11:07pm UTC](https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325/2 "2020-05-19T23:07:42Z")

</div>

> [@ELK212](#):
>
> Maybe lets say all devices in a specific range will get index "X" and other ones get index "Y"?

You could do that with a conditional block and then add a tag to the event with mutate. That'd be the easiest way I can think of.

---

<div class="post-metadata">

**Author:** ![Feedy](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@Feedy](https://discuss.elastic.co/u/Feedy)\
**Post date:** [May 19, 2020, 11:24pm UTC](https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325/3 "2020-05-19T23:24:33Z")

</div>

Are you using filebeat to send logs to Logstash?

---

<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:** [June 16, 2020, 11:24pm UTC](https://discuss.elastic.co/t/how-to-separate-devices-logfiles/233325/4 "2020-06-16T23:24:35Z")

</div>

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