# Index overwritten by another index

**URL:** <https://discuss.elastic.co/t/index-overwritten-by-another-index/197362>\
**Category:** Logstash\
**Created:** [August 29, 2019, 2:28pm UTC](https://discuss.elastic.co/t/index-overwritten-by-another-index/197362 "2019-08-29T14:28:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anthony\_BRETON](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anthony_breton/32/53298_2.png) [@Anthony\_BRETON](https://discuss.elastic.co/u/Anthony_BRETON)\
**Post date:** [August 29, 2019, 2:28pm UTC](https://discuss.elastic.co/t/index-overwritten-by-another-index/197362/1 "2019-08-29T14:28:23Z")

</div>

Hi,

I'm a new user to ELK and I haven't experience.

I have installed ELK 7.3 on Ubuntu 19.04 x64 and I want to get own Nginx and Fail2Ban log.

Elasticsearch, Logstash, Filebeat and Kibana are installed on the same server.

Filebeat is configured for OutPut to Logstash :

```
output.logstash:
hosts: ["localhost:5044"]

```

Nginx Filebeat module is enable.

I use the following conf logstash :

**fail2ban.conf :**

> input {  
> file {  
> path =\> "/var/log/fail2ban.log"  
> type =\> "fail2ban"  
> # start\_position =\> "beginning"  
> }  
> }
> 
> filter {  
> if [type] == "fail2ban" {  
> grok {  
> match =\> ["message", "%{TIMESTAMP\_ISO8601:bantime} %{PROG}%{SPACE}([%{POSINT}])?: %{WORD}%{SPACE}[%{GREEDYDATA:jail}] %{WORD:action} %{IPV4:ip}" ]  
> add\_tag =\> ["%{action}"]  
> named\_captures\_only =\> true  
> }
> 
> if "\_grokparsefailure" in [tags] {  
> drop { }  
> }
> 
> date {  
> match =\> ["bantime", "ISO8601"]  
> target =\> "bantime"  
> }
> 
> geoip {  
> source =\> "ip"  
> }  
> }  
> }
> 
> output {  
> elasticsearch {  
> hosts =\> localhost  
> index =\> "f2b-%{+YYYY.MM.dd}"  
> }  
> }

**nginx.conf :**

> input {  
> beats {  
> port =\> 5044  
> host =\> "0.0.0.0"  
> }  
> }
> 
> filter {  
> grok {  
> match =\> ["message" , "%{COMBINEDAPACHELOG}+%{GREEDYDATA:extra\_fields}"]  
> overwrite =\> ["message"]  
> }  
> mutate {  
> convert =\> ["response", "integer"]  
> convert =\> ["bytes", "integer"]  
> convert =\> ["responsetime", "float"]  
> }  
> geoip {  
> source =\> "clientip"  
> target =\> "geoip"  
> add\_tag =\> ["nginx-geoip"]  
> }  
> date {  
> match =\> ["timestamp" , "dd/MMM/YYYY:HH:mm:ss Z"]  
> remove\_field =\> ["timestamp"]  
> }  
> useragent {  
> source =\> "agent"  
> }  
> }
> 
> output {  
> elasticsearch {  
> hosts =\> localhost  
> manage\_template =\> false  
> index =\> "ngx-%{+YYYY.MM.dd}"  
> }  
> }

**My probrem :**

When a active Logstash fail2ban.conf and i create Index : it's OK  
When a active Logstash nginx.conf and i create Index : it's OK

But, when automatic index is created the next day, my index **fail2ban** is **overwrite** with **nginx** index data.

I don't understand

Have you an idea ?

Thank you very munch

---

<div class="post-metadata">

**Author:** ![BennyInc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bennyinc/32/21751_2.png) [@BennyInc](https://discuss.elastic.co/u/BennyInc)\
**Post date:** [August 29, 2019, 2:41pm UTC](https://discuss.elastic.co/t/index-overwritten-by-another-index/197362/2 "2019-08-29T14:41:54Z")

</div>

I guess the issue here is, that you run 1 Logstash instance with both configs. This would merge your config files to one big pipeline.  
What you want to do, is [configure Logstash to run with multiple pipelines](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html), one for each config file.

---

<div class="post-metadata">

**Author:** ![Anthony\_BRETON](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anthony_breton/32/53298_2.png) [@Anthony\_BRETON](https://discuss.elastic.co/u/Anthony_BRETON)\
**Post date:** [September 2, 2019, 9:22am UTC](https://discuss.elastic.co/t/index-overwritten-by-another-index/197362/3 "2019-09-02T09:22:10Z")

</div>

Thank you very munch, it's all right !

---

<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:** [September 30, 2019, 9:25am UTC](https://discuss.elastic.co/t/index-overwritten-by-another-index/197362/4 "2019-09-30T09:25:31Z")

</div>

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