# Separate indexes for grok filters

**URL:** https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034
**Category:** Logstash
**Created:** [March 18, 2020, 6:24am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034 "2020-03-18T06:24:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nikhilesh](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nikhilesh](https://discuss.elastic.co/u/nikhilesh)
#### Post date: [March 18, 2020, 6:24am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034/1 "2020-03-18T06:24:54Z")

</div>

I am wondering how to create separated indexes for different logs fetched into logstash (which were later passed onto elasticsearch), so that in kibana,

In my case, I have a few client servers (each of which is installed with `filebeat` ) and a centralized log server ( `ELK` ). Each client server has different kinds of logs. (i.e. one filebeat should read one grok filter and another filebeat should read another grok filter)

i am using ELK 7.6 , i heard that document\_type was deprecated . so how to achieve this.

---

<div class="post-metadata">

### Author: ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)
#### Post date: [March 18, 2020, 8:24am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034/2 "2020-03-18T08:24:05Z")

</div>

Hi there,

add a [tag](https://www.elastic.co/guide/en/beats/filebeat/master/add-tags.html) in your filebeat and in your logstash pipeline separate actions to take with a `if...else` statement on the tags field (or whatever other field you're putting your tags into).

---

<div class="post-metadata">

### Author: ![nikhilesh](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nikhilesh](https://discuss.elastic.co/u/nikhilesh)
#### Post date: [March 18, 2020, 8:27am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034/3 "2020-03-18T08:27:59Z")

</div>

Hi Fabio,  
what tag we have to add in filebeat yml file? i have added  
if type ==[xxx] in logstash filter section. so how filebeat will read/direct to that particular tag(xxx) in logstash..

---

<div class="post-metadata">

### Author: ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)
#### Post date: [March 18, 2020, 8:35am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034/4 "2020-03-18T08:35:00Z")

</div>

Will it work if in your filebeat.yml you put something like

```
- add_tags:
    tags: [xxx]
    target: "type"

```

and in your logstash conf file a check like: `if "xxx" in [type]` ?

---

<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: [April 15, 2020, 8:35am UTC](https://discuss.elastic.co/t/separate-indexes-for-grok-filters/224034/5 "2020-04-15T08:35:13Z")

</div>

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