# Redis module

**URL:** <https://discuss.elastic.co/t/redis-module/227299>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 9, 2020, 10:54am UTC](https://discuss.elastic.co/t/redis-module/227299 "2020-04-09T10:54:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [April 9, 2020, 10:54am UTC](https://discuss.elastic.co/t/redis-module/227299/1 "2020-04-09T10:54:34Z")

</div>

Hi,  
in my current scenario I have 2 different Redis instances running on the same server.  
I have installed Metricbeat and enabled its module; is there a way to collect data from both instances? should I just put them into `hosts` field contained in `redis.module`?  
is there a way to add a tag to them? for instance, when I get data from instance `A` I want the tag `AAA` while for instance `B` I want the tag `BBB`

thanks

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [April 9, 2020, 11:24am UTC](https://discuss.elastic.co/t/redis-module/227299/2 "2020-04-09T11:24:21Z")

</div>

Hi @rschirin,

Yes, you can add multiple hosts into the `hosts` field, and then events will have a different `service.address`, each one with one of the `ip:port`s, like this:

```auto
- module: redis
  hosts: ['localhost:6379', 'localhost:16379']
  ...

```

If you want to add other custom fields then you need to configure multiple modules, something like this:

```auto
- module: redis
  hosts: ['localhost:6379']
  ...
  fields:
    instance: 'AAA'
- module: redis
  hosts: ['localhost:16379']
  ...
  fields:
    instance: 'BBB'

```

Or you can also use the [ECS `service.name` field](https://www.elastic.co/guide/en/ecs/1.4/ecs-service.html), that can be set in metricbeat modules like this:

```auto
- module: redis
  hosts: ['localhost:6379']
  ...
  service.name: 'AAA'
- module: redis
  hosts: ['localhost:16379']
  ...
  service.name: 'BBB'

```

---

<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:** [May 7, 2020, 11:24am UTC](https://discuss.elastic.co/t/redis-module/227299/3 "2020-05-07T11:24:24Z")

</div>

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