Redis

Parses Redis’s configuration files

Author: Marc Fournier marc.f.nosp@m.ournier@camptoc.nosp@m.amp.com

Summary
RedisParses Redis’s configuration files
ReferenceThis lens is based on Redis’s default redis.conf
Usage Example
LicenseThis file is licensed under the LGPL v2+, like the rest of Augeas.
Augeas Lenses
standard_entryA standard entry is a key-value pair, separated by blank space, with optional blank spaces at line beginning & end.
save_entryEntries identified by the “save” keyword can be found more than once.
slaveof_entryEntries identified by the “slaveof” keyword can be found more than once.
save_entryEntries identified by the “rename-command” keyword can be found more than once.
lnsThe Redis lens

Reference

This lens is based on Redis’s default redis.conf

Usage Example

augtool> set /augeas/load/Redis/incl "/etc/redis/redis.conf"
augtool> set /augeas/load/Redis/lens "Redis.lns"
augtool> load

augtool> get /files/etc/redis/redis.conf/vm-enabled
/files/etc/redis/redis.conf/vm-enabled = no
augtool> print /files/etc/redis/redis.conf/rename-command[1]/
/files/etc/redis/redis.conf/rename-command
/files/etc/redis/redis.conf/rename-command/from = "CONFIG"
/files/etc/redis/redis.conf/rename-command/to = "CONFIG2"

augtool> set /files/etc/redis/redis.conf/activerehashing no
augtool> save
Saved 1 file(s)
augtool> set /files/etc/redis/redis.conf/save[1]/seconds 123
augtool> set /files/etc/redis/redis.conf/save[1]/keys 456
augtool> save
Saved 1 file(s)

The Test_Redis file also contains various examples.

License

This file is licensed under the LGPL v2+, like the rest of Augeas.

Augeas Lenses

standard_entry

let standard_entry = [ indent . key k . del_ws_spc . Quote.do_quote_opt_nil (store v) . eol ]

A standard entry is a key-value pair, separated by blank space, with optional blank spaces at line beginning & end.  The value part can be optionnaly enclosed in single or double quotes.  Comments at end-of-line ar NOT allowed by redis-server.

save_entry

let save_entry = [ indent . key save . del_ws_spc . seconds . del_ws_spc . keys . eol ]

Entries identified by the “save” keyword can be found more than once.  They have 2 mandatory parameters, both integers.  The same rules as standard_entry apply for quoting, comments and whitespaces.

slaveof_entry

let slaveof_entry = [ indent . key slaveof . del_ws_spc . ip . del_ws_spc . port . eol ]

Entries identified by the “slaveof” keyword can be found more than once.  They have 2 mandatory parameters, the 1st one is an IP address, the 2nd one is a port number.  The same rules as standard_entry apply for quoting, comments and whitespaces.

save_entry

Entries identified by the “rename-command” keyword can be found more than once.  They have 2 mandatory parameters, both strings.  The same rules as standard_entry apply for quoting, comments and whitespaces.

lns

let lns = (comment | empty | standard_entry | save_entry | renamecmd_entry | slaveof_entry )*

The Redis lens

let standard_entry = [ indent . key k . del_ws_spc . Quote.do_quote_opt_nil (store v) . eol ]
A standard entry is a key-value pair, separated by blank space, with optional blank spaces at line beginning & end.
let save_entry = [ indent . key save . del_ws_spc . seconds . del_ws_spc . keys . eol ]
Entries identified by the “save” keyword can be found more than once.
let slaveof_entry = [ indent . key slaveof . del_ws_spc . ip . del_ws_spc . port . eol ]
Entries identified by the “slaveof” keyword can be found more than once.
let lns = (comment | empty | standard_entry | save_entry | renamecmd_entry | slaveof_entry )*
The Redis lens
Provides unit tests and examples for the Redis lens.
Close