> For the complete documentation index, see [llms.txt](https://syslog-macos-testing.gitbook.io/syslog-macos-testing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syslog-macos-testing.gitbook.io/syslog-macos-testing/modules/redis-1.md).

# redis \[1]

The Redis module has only one driver, which is the Redis() destination driver. The Redis() driver sends messages as name-value pairs to a Redis key-value store.

### Status

| Architecture | Status |
| :----------: | :----: |
|      x86     |  Works |
|      ARM     |  Works |

### Testing

**Redis Setup**

To test this driver, we need to set up a Redis store first. You can use Homebrew to brew install all the necessary dependencies.&#x20;

To be able to successfully test this driver, we need to install Redis and libHIREDIS. To install all these, we need to do the following:&#x20;

`$ brew install redis`\
`$ brew install hiredis`

To run Redis in the background, use:  \
\
`$ brew services start redis`

Once we do this, we can use the Redis CLI to monitor for messages that we will send using syslog-ng. To do this, use the `monitor` command on Redis CLI.\
\
`$ redis-cli`\
`127.0.0.1:6379> MONITOR`

{% hint style="info" %}
Note: Localhost on port 6379 is the default setting for redis.&#x20;
{% endhint %}

### Configuration File Used

```
@version: 3.33
@include "scl.conf"

options {
    stats-freq(10);
    time-reopen(10);
};

source custom
{
    example-msg-generator(
        num(20)
        freq(5)
        template("Message to Redis")
    );
};

destination d_redis {
    redis(
        host("localhost")
        port(6379)
        command("HINCRBY", "hosts", "$HOST", "$MESSAGE")
    );
};

log {
    source(custom);
    destination(d_redis);
};
```

### Proof

![Redis Destination Driver Tested on MacOS (x86)](https://3267548193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaZdBoDvCx_0JwOUICk%2F-MflBlUS4xPT-LI7JAlp%2F-Mfwvm83_Bl6pAf5qaVk%2FScreenshot%202021-07-31%20at%205.19.17%20PM.png?alt=media\&token=39702a55-7a42-435d-afa5-5f858b7e974a)

![Redis Destination Driver Tested on MacOS (ARM)](https://3267548193-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaZdBoDvCx_0JwOUICk%2F-Mfwvv3IRfGEJrMzeOFr%2F-Mfx231VIvC4lkM3ETTQ%2FScreen%20Shot%202021-07-31%20at%205.42.33%20PM.png?alt=media\&token=bbda5e88-6eac-4021-990c-c70710787263)
