Skip to content

juttle/juttle-redis-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Juttle Redis Adapter

Build Status

The Juttle Redis Adapter enables interaction with Redis. It works with Redis version 3.0 and above.

Examples

Write a Hash into Redis at the key my_hash with values a = 1, b = 2, c = 3:

emit -points [{ a: 1, b: 2, c: 3, id: 'my_hash' }]
    | put redis_write_command = 'HMSET ${id} a ${a} b ${b} c ${c} time ${time}'
    | write redis

Retrieve the value stored at my_hash:a above as the point {value: 1}:

read redis -raw "HGET my_hash a"

Installation

Like Juttle itself, the adapter is installed as a npm package. Both Juttle and the adapter need to be installed side-by-side:

$ npm install juttle
$ npm install juttle-redis-adapter

Configuration

The adapter needs to be registered and configured so that it can be used from within Juttle. To do so, add the following to your ~/.juttle/config.json file:

{
    "adapters": {
        "juttle-redis-adapter": {
            "host": "localhost",
            "port": 6379
        }
    }
}

To connect to a Redis instance elsewhere, change the address and port in this configuration.

Usage

Read options

Name Type Required Description Default
raw string yes redis command to run none

Write

write takes no options. It simply executes the Redis command stored in the redis_write_command field of each point it processes. To format the redis_write_command with fields from the point, use string templating as in the example.

Contributing

Want to contribute? Awesome! Don’t hesitate to file an issue or open a pull request.

About

A redis backend for Juttle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published