redisniffer
Version, currently 0.3.44 versions
- 0.5.0latestMar 30, 2017
- 0.4.0not indexedMay 22, 2020
- 0.3.4not indexedMay 22, 2020
- 0.3.3not indexedMay 22, 2020
github.com/maiha/redisniffer
Sniff redis packets and summarize count of commands
Nothing has been indexed for 0.3.4 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
redisniffer:
github: maiha/redisniffer
version: ~> 0.3.4Then run:
shards installshard.yml
No shard.yml has been indexed for 0.3.4. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
redisniffer 
Sniff redis packets and summarize count of commands.
- x86_64 binary: https://github.com/maiha/redisniffer/releases
Usage
Needs root user or privilege to the device.
% redisniffer
listening on lo about '(tcp port 6379)' (snaplen: 1500, timeout: 1000)
output: Stdout
[6379, {"PING" => 1}, nil]
[6379, {"GET" => 1}, nil]
Options
-p 6379,7001,7002: capture port--deny MONITOR,PING: these cmds are not stored in stats--include-ip: stores client ip addresses too-o redis://localhost:6379: write stats into redis-o file://cmds.log: write stats into file
See redisniffer --help for more options
Redis output
-o option enables you to store stats in redis.
% redisniffer -i eth0 -p 6379 -o redis://localhost:6000 --out-interval 60
This watches 6379 port on eth0 and writes stats into redis(port=6000) as ZSET every minute.
redis:6000
Three ZSET entries related to the time will be updated.
- "6379/20170322"
- "6379/2017032217"
- "6379/201703221737"
Thus, we can easily get cmd stats by ZRANGE about three kind of time-series.
# want to know top 3 commands at 20170322 on port 6379
% redis-cli -p 6000 ZREVRANGE "6379/20170322" 0 2 WITHSCORES
1) "DEL"
2) "174"
3) "SET"
4) "86"
5) "SADD"
6) "68"
NOTES
- time-series are hard-coded. (daily, hourly, every minute)
- ttl is hard-coded. (4.weeks, 3.days, 3.hours)
- key format is "{PORT}/{TIME}" in default. (
--out-cmd-keyoption overrides it)- where
{PORT}and{TIME}are reserved words those will be replaced with runtime values.
- where
see: src/data/redis_flusher.cr
Roadmap
- [x] file output
- [x] use pipeline in storing into redis
- [x] store client ip address into redis
- [x] write tests
Development
- crystal: 0.21.1
- needs
libpcap - type
make
Contributing
- Fork it ( https://github.com/maiha/redisniffer.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- maiha maiha - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.4- Tagged
- May 22, 2020
- Commit
d33adc7cd0a5- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/maiha/redisniffer
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 4