# Sending events from specific ip adress to specific index

**URL:** https://discuss.elastic.co/t/sending-events-from-specific-ip-adress-to-specific-index/314344
**Category:** Logstash
**Created:** [September 13, 2022, 10:20pm UTC](https://discuss.elastic.co/t/sending-events-from-specific-ip-adress-to-specific-index/314344 "2022-09-13T22:20:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wmulobole1](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@wmulobole1](https://discuss.elastic.co/u/wmulobole1)
#### Post date: [September 13, 2022, 10:20pm UTC](https://discuss.elastic.co/t/sending-events-from-specific-ip-adress-to-specific-index/314344/1 "2022-09-13T22:20:03Z")

</div>

Hi, I am trying to separate my indexes by ip address. I want logs coming from three particular ips to go a specific index and the rest to go another index. I am not successful because the index is not showing up in Kibana. Could it be a problem with my filter in the logstash config.  
Here is my logstash config

```auto
 filter {
  if [host.ip] =~ /^10\.25\.20\.(103|104|105)/ {
    mutate { add_tag => ["poller"] }
  } 
   else {
    mutate { add_tag => ["generic"] }
  }
}
 
output {
if "poller" in [tags] {
   elasticsearch {
     hosts => ["http://10.25.20.107:9200"]
     index => "poller-logs-%{+YYYY.MM.dd}"
     }
   }
   else if "generic" in [tags] {
   elasticsearch {
     hosts => ["http://10.25.20.107:9200"]
     index => "other-events-%{+YYYY.MM.dd}"
     }
   }
   else {
   elasticsearch {
     hosts => ["http://10.25.20.107:9200"]
     }
   }
}

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [September 13, 2022, 11:36pm UTC](https://discuss.elastic.co/t/sending-events-from-specific-ip-adress-to-specific-index/314344/2 "2022-09-13T23:36:16Z")

</div>

> [@wmulobole1](#):
>
> `if [host.ip] =~`

That should very likely be `if [host][ip] =~`.

Even then in recent versions of logstash the elasticsearch output has ILM enabled by default so the index option is ignored.

---

<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: [October 11, 2022, 11:36pm UTC](https://discuss.elastic.co/t/sending-events-from-specific-ip-adress-to-specific-index/314344/3 "2022-10-11T23:36:37Z")

</div>

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