NAME
recs-fromkv
recs-fromkv --help-all
Usage : recs-fromkv <args> [<files>]
Records are generated from character input with the form "<record><record-
delim><record>...". Records have the form "<entry><entry-delim><entry>...".
Entries are pairs of the form "<key><kv-delim><value>".
Arguments:
--record-delim|r <delim> Delimiter to for separating records (defaults
to "END\n").
--entry-delim|e <delim> Delimiter to for separating entries within
records (defaults to "\n").
--kv-delim|f <delim> Delimiter to for separating key/value pairs
within an entry (defaults to " ").
--filename-key|fk <keyspec> Add a key with the source filename (if no
filename is applicable will put NONE)
Help Options:
--help This help screen
Examples:
Parse memcached stat metrics into records
echo -ne 'stats\r\n' | nc -i1 localhost 11211 | tr -d "\r" | awk '{if (! /END/) {print $2" "$3} else {print $0}}' | recs-fromkv
Parse records separated by "E\n" with entries separated by '|' and pairs separated by '='
recs-fromkv --kv-delim '=' --entry-delim '|' --record-delim $(echo -ne "E\n")
Parse records separated by "%\n" with entries separated by "\n" and pairs separated by '='
recs-fromkv --kv-delim '=' --record-delim $(echo -ne "%\n")
Parse records separated by '%' with entries separated by '|' and pairs separated by '='
recs-fromkv --kv-delim '=' --entry-delim '|' --record-delim '%'
SEE ALSO
See App::RecordStream for an overview of the scripts and the system
Run
recs examples
or see App::RecordStream::Manual::Examples for a set of simple recs examplesRun
recs story
or see App::RecordStream::Manual::Story for a humorous introduction to RecordStreamEvery command has a
--help
mode available to print out usage and examples for the particular command, just like the output above.